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: 

Reg: Data Selection

sreeramkumar_madisetty
Active Contributor
0 Kudos

Experts,

I have a typical requirement that:

I have given data in a file format to load into sap.

*Field1 Field2 Field3 Field4 Field5 +Field6 Filed7+*

My file format is like above.

In this, Field1 Field2 are Project Definitions.

Field3 Field4 Field5 are WBS Elements.

Field6 Filed7 are Settlement Rules.

the data for the file will be as follows.

*Field1 Field2 Field3 Field4 Field5 +Field6 Filed7+*

100 TEST 100.1 TEST.1 X 100.2 Y

100.1.1 TEST.1.1 X 100.2 Y

100.1.2 TEST.1.2 X 100.2 Y

101 TEST 101.1 TEST.1 X 100.2 Y

101.1.1 TEST.1.1 X 100.2 Y

101.1.2 TEST.1.2 X 100.2 Y

Here data loading is carried using BAPI's:

To Load WBS Elements,

CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'

EXPORTING

i_project_definition = i_project_definition

TABLES

it_wbs_element = i_wbsmasterdata

et_return = i_return.

So my requirement is:Using 100 as Project Definition,have to create WBS related to 100,using 101 as Project Definition,have to create WBS related to 101 etc...

Can anyone please suggest me the logic.

Regards,

Sreeram

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Loop through the internal table which holds the data.

AT NEW <*Field1>.

Move the <*Field1> to your i_project_defenition.

END AT.

Move your WBS elements to the i_wbsmasterdata. * Note : this is shoudl be done for every loop pass.

Append i_wbsmasterdata.

AT END OF <*Field1>.

Call BAPI "BAPI_BUS2054_CREATE_MULTI".

END AT.

End loop.

Hope this will help you.

Regards,

Smart Varghese

2 REPLIES 2

sreeramkumar_madisetty
Active Contributor
0 Kudos

Experts,

Can anyone please provide me some solution.

Regards,

Sreeram

Former Member
0 Kudos

Hi,

Loop through the internal table which holds the data.

AT NEW <*Field1>.

Move the <*Field1> to your i_project_defenition.

END AT.

Move your WBS elements to the i_wbsmasterdata. * Note : this is shoudl be done for every loop pass.

Append i_wbsmasterdata.

AT END OF <*Field1>.

Call BAPI "BAPI_BUS2054_CREATE_MULTI".

END AT.

End loop.

Hope this will help you.

Regards,

Smart Varghese