Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8735

Am writing code for costcenter validation.please have a look into this.........

$
0
0

Hi Experts,


if user enter wrong cost center it need to show cost center does not exits.below i had written piece of code am doing this in user exit include program.


Plz help me..


Thnaks,

Mounika


TYPES : BEGIN OF ty_csks,

        kostl like csks-kostl,

        prctr like csks-prctr,

 

        END OF ty_csks,

 

         BEGIN OF ty_marc,

       matnr type matnr,

      werks type werks_d,

     END OF ty_marc.

 

 

DATA : it_csks TYPE TABLE OF ty_csks,

        wa_csks LIKE LINE OF ty_csks,

       it_marc TYPE TABLE OF ty_marc,

       wa_marc LIKE LINE OF ty_marc.

.

 

SELECT KOSTL PRCTR WERKS FROM CSKS INTO TABLE IT_CSKS WHERE KOSTL = 'CHAR' AND

                                                        PRCTR = 'CHAR'.

IF SY-SUBRC EQ 0.

WRITE : 'VALUE FOUND'.

ELSE.

WRITE : 'NO SUCH DATA FOUND'.

ENDIF.

 

SELECT MATNR WERKS PRCTR FROM MARC INTO TABLE IT_MARC WHERE MATNR = 'CHAR' AND

                                                       WERKS = 'CHAR' .

 

IF SY-SUBRC EQ 0.

WRITE : 'VALUE FOUND'.

ELSE.

WRITE : 'NO SUCH DATA FOUND'.

ENDIF.

 

ENDFUNCTION.


Viewing all articles
Browse latest Browse all 8735

Trending Articles