05-21-2009 7:47 AM
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
05-21-2009 9:32 AM
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
05-21-2009 8:54 AM
Experts,
Can anyone please provide me some solution.
Regards,
Sreeram
05-21-2009 9:32 AM
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