Application Development 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: 

Example of RFC_GET_MATERIAL_DATA

Former Member
0 Kudos

Hi,

I am trying to use the RFC_GET_MATERIAL_DATA but I am not sure about the import and export parameters. Can anyone provide me with an example?

Thank you in advance,

Sunny

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi SAnsanee,

you have to pass I_MATERIAL, have to declare,

internal tables, in which you'll receive material data

and IMPORTING parameters.

Paste this code in your report and execute,

now check that you are getting data or not?

if not try degugging.

data:I_MATERIAL LIKE  MARA-MATNR,
   E_RETURN LIKE CAD_RETURN-VALUE,
    E_MESSAGE LIKE MESSAGE-MSGTX,     
  IT_SAP_FIELD_DATA type standard table of RFCDMSDATA,
     IT_DMS_CLASS_DATA type standard table of  CLS_CHARAC.
    

move '100-100' to MATERIAL.

CALL FUNCTION 'RFC_GET_MATERIAL_DATA'
  EXPORTING
    I_MATERIAL           =  I_MATERIAL
 IMPORTING
   E_RETURN             =  E_RETURN
   E_MESSAGE            =  E_MESSAGE
  TABLES
    SAP_FIELD_DATA       = IT_SAP_FIELD_DATA
    DMS_CLASS_DATA       = IT_DMS_CLASS_DATA  . 

hope it'll help you.

Regards,

Narinder Hartala

2 REPLIES 2

athavanraja
Active Contributor
0 Kudos

Just pass the material number to i_material import parameter.

Regards

Raja

Former Member
0 Kudos

Hi SAnsanee,

you have to pass I_MATERIAL, have to declare,

internal tables, in which you'll receive material data

and IMPORTING parameters.

Paste this code in your report and execute,

now check that you are getting data or not?

if not try degugging.

data:I_MATERIAL LIKE  MARA-MATNR,
   E_RETURN LIKE CAD_RETURN-VALUE,
    E_MESSAGE LIKE MESSAGE-MSGTX,     
  IT_SAP_FIELD_DATA type standard table of RFCDMSDATA,
     IT_DMS_CLASS_DATA type standard table of  CLS_CHARAC.
    

move '100-100' to MATERIAL.

CALL FUNCTION 'RFC_GET_MATERIAL_DATA'
  EXPORTING
    I_MATERIAL           =  I_MATERIAL
 IMPORTING
   E_RETURN             =  E_RETURN
   E_MESSAGE            =  E_MESSAGE
  TABLES
    SAP_FIELD_DATA       = IT_SAP_FIELD_DATA
    DMS_CLASS_DATA       = IT_DMS_CLASS_DATA  . 

hope it'll help you.

Regards,

Narinder Hartala