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

How to save data in internal table using BAPI_MATERIAL_GETLIST.

Former Member
0 Likes
760

Hi ,

I'm a beginner to ABAP so I need some help from you experts.

This is my scenario .

" First I've to get materials from the plant & storage location using BAPI_MATERIAL_GETLIST.

The output has to in the below data : material, matl_desc and this output result has to be saved in an internal table XYZ".

It would be better if I get the ans in Steps or in sequential manner.

1 ACCEPTED SOLUTION
Read only

surajarafath
Contributor
0 Likes
459

Hi suhas,

First fill up the selection details in the bapi to reterive the materials,

then get the material details in the table and populate into your internal table XYZ..

DATA: MATNRLIST TYPE TABLE OF BAPIMATLST,

          PLANTSELECTION TYPE TABLE OF BAPIMATRAW.

PLANTSELECTION-SIGN = 'I'

PLANTSELECTION-OPTION = 'EQ'

PLANTSELECTION-LOW = '1000'

APPEND PLANTSELECTION.

like this fillup your selection and pass it to the bapi

Call bapi BAPI_MATERIAL_GETLIST

TABLES

PLANTSELECTION = PLANTSELECTION

....

MATNRLIST              =  MATNRLIST

and you will get the list of materials in the MATNRLIST internal table...

loop MATNRLIST and move the data to your internal table if required...

Before you doing this, understand the flow and structures of the BAPI then it would be easier to do..

1 REPLY 1
Read only

surajarafath
Contributor
0 Likes
460

Hi suhas,

First fill up the selection details in the bapi to reterive the materials,

then get the material details in the table and populate into your internal table XYZ..

DATA: MATNRLIST TYPE TABLE OF BAPIMATLST,

          PLANTSELECTION TYPE TABLE OF BAPIMATRAW.

PLANTSELECTION-SIGN = 'I'

PLANTSELECTION-OPTION = 'EQ'

PLANTSELECTION-LOW = '1000'

APPEND PLANTSELECTION.

like this fillup your selection and pass it to the bapi

Call bapi BAPI_MATERIAL_GETLIST

TABLES

PLANTSELECTION = PLANTSELECTION

....

MATNRLIST              =  MATNRLIST

and you will get the list of materials in the MATNRLIST internal table...

loop MATNRLIST and move the data to your internal table if required...

Before you doing this, understand the flow and structures of the BAPI then it would be easier to do..