Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

query

Former Member
0 Likes
479

hi all

i have a small problem

i have to use function module conversion_exit_ccmat_input to convert the matnr in to the key

the input parameter is mara-matnr.......which is defined in one internal table say(i_mat) while using for all entries to another itab the condition given is..that this i_mat-matnr = i_ausp-objek. for this the type in matnr and objek shud be same.

for this i am using the above exit. but how to use the fm? i mean if the import parameter is i_mat-matnr, then what to put as the o/p parameter and how to use the o/p.

thanks in advance

3 REPLIES 3
Read only

Former Member
0 Likes
426

Hello,

Do like this


  DATA: BEGIN OF L_T_OBJECT OCCURS 0,
         OBJEK TYPE OBJNUM,
         MATNR TYPE MATNR,
        END OF L_T_OBJECT.
  DATA: L_OBJECTS TYPE TY_OBJECTS.
  CLEAR: L_T_OBJECT.
  REFRESH: L_T_OBJECT.
* Fill the object number
  LOOP AT G_T_MAT INTO G_R_MAT.        " Check Here
    AT NEW MATNR.
      L_T_OBJECT-OBJEK = G_R_MAT-MATNR.
      L_T_OBJECT-MATNR = G_R_MAT-MATNR.
      APPEND L_T_OBJECT.
    ENDAT.
  ENDLOOP.
  CLEAR:G_T_OBJECTS,G_T_CLASSDESC,G_T_CHARDESC,G_T_CABN,G_T_KSML,
        G_T_CAWNT.
  REFRESH: G_T_OBJECTS,G_T_CLASSDESC,G_T_CHARDESC,G_T_CABN,G_T_KSML,
           G_T_CAWNT.
* Get the material classification details
  SELECT A~CUOBJ A~OBJEK A~KLART B~ATINN B~ATZHL B~ATWRT B~ATFLV
         B~ATAWE B~ATFLB B~ATAW1 C~CLINT D~CLASS
    INTO CORRESPONDING FIELDS OF TABLE G_T_OBJECTS
    FROM INOB AS A INNER JOIN AUSP AS B
      ON A~CUOBJ = B~OBJEK AND
         A~KLART = B~KLART
         INNER JOIN KSSK AS C
         ON B~OBJEK = C~OBJEK AND
            B~KLART = C~KLART
         INNER JOIN KLAH AS D
         ON C~CLINT = D~CLINT
     FOR ALL ENTRIES IN L_T_OBJECT
   WHERE A~OBJEK EQ L_T_OBJECT-OBJEK AND           " Check Here
         A~OBTAB EQ 'MARA'  AND
         A~KLART IN S_KLART AND
         B~ADZHL EQ '0000'  AND
         C~LKENZ EQ ' '     AND
         D~CLASS IN S_CLASS.

Thanks !!

Vasanth

Read only

0 Likes
426

thank u vasanth..

but dont we need to use the function module?

Read only

0 Likes
426

Hello,

I am using this code in my report and it works fine.

Try it in report also.

It is not needed to convert the material using FM....

Regards,

Vasanth