‎2008 Jun 04 9:24 AM
Hi all,
I m totally new for fm & bapi.
When we execute std bapi_material_savedata,How w decide which parameters, tables need to be pass.
There is special icon against some import parametrs.What does that mean.
Best Regards,
Aastha
‎2008 Jun 04 10:39 AM
Hi Astha,
It's easy to understand which fields needs to passed by looking at documentation associated with each of the parameter.
Open the FM in SE37
This FM is used for both creation and updation of the materials into the system.
you need provide at least some basic vales such as material number (in case you are updating- you should pass material number)
for different view associated with material, it has different fields as mandatory
Such as for sales view you need to pass sales org, sales group
for Purchase view you need to pass pruchase org
Regards,
Amit R.
‎2008 Jun 04 9:29 AM
Use transaction SE37, enter BAPI_MATERIAL_SAVEDATA in function module and click on Display. All parameters imported and exported, tables etc are shown. You can see there which are optional or not. Also, useful is the function module documentation
‎2008 Jun 04 9:29 AM
Hi Aastha,
Fill the following structures.
HEADDATA
CLIENTDATA
CLIENTDATAX
The structures with suffix 'X' are containing update flags.Fill those fields which you want to update.
‎2008 Jun 04 10:01 AM
Hi Vishal,
I want to ask that what u maen by this The structures with suffix 'X' are containing update flags.
Plz Plz tell me in detail.
When i click on HEADDATA
CLIENTDATA
CLIENTDATAX
No of columns appear, how v judge what v have to fill.
Best Regards,
Aastha
‎2008 Jun 04 9:44 AM
hi,
First you have to identify the Function module in BAPI explorer
i will expalin with an example.
Suppose you want to create a pgm
1. use transaction BAPI
2. Suppose we r searching for a BAPI related to Purchase order
, which is in MM
3.so we have to select from the list MM->PURCHASING>PURCHASE ORDER.
4.We have to get the purchase order details , So doble click on Get Details
5. identify the functionmodule name.
6.Now expand get list
7. We need purchase orde header details , so double click on it ; you will get the dictionary reference in the right frame.
8.Which we will make use in the report.
example:
REPORT ZUK_WIP09_BAPI_MM.
DATA : I_EKPO TYPE TABLE OF BAPIEKPO ,
W_EKPO TYPE BAPIEKPO.
PARAMETERS: P_EBELN LIKE EKKO-EBELN OBLIGATORY VALUE CHECK.
CALL FUNCTION 'BAPI_PO_GETDETAIL'
EXPORTING
PURCHASEORDER = P_EBELN
ITEMS = 'X'
ACCOUNT_ASSIGNMENT = ' '
SCHEDULES = ' '
HISTORY = ' '
ITEM_TEXTS = ' '
HEADER_TEXTS = ' '
SERVICES = ' '
CONFIRMATIONS = ' '
SERVICE_TEXTS = ' '
EXTENSIONS = ' '
IMPORTING
PO_HEADER =
PO_ADDRESS =
TABLES
PO_HEADER_TEXTS =
PO_ITEMS = I_EKPO
PO_ITEM_ACCOUNT_ASSIGNMENT =
PO_ITEM_SCHEDULES =
PO_ITEM_CONFIRMATIONS =
PO_ITEM_TEXTS =
PO_ITEM_HISTORY =
PO_ITEM_HISTORY_TOTALS =
PO_ITEM_LIMITS =
PO_ITEM_CONTRACT_LIMITS =
PO_ITEM_SERVICES =
PO_ITEM_SRV_ACCASS_VALUES =
RETURN =
PO_SERVICES_TEXTS =
EXTENSIONOUT =
.
LOOP AT I_EKPO INTO W_EKPO.
WRITE : / W_EKPO-PO_NUMBER,SY-VLINE,W_EKPO-PO_ITEM,SY-VLINE,W_EKPO-CO_CODE,SY-VLINE.
ENDLOOP.
example :
REPORT ZSD_ABD_SALES_CREATION.
*tables:bapisdhd1,bapiparnr,bapisditm.
data: w_bapisdhd1 LIKE bapisdhd1 occurs 0 with header line.
data: i_bapipanr like bapiparnr occurs 0 with header line.
data: i_bapisditm like bapisditm occurs 0 with header line.
data: v_vbeln type vbap-vbeln.
data: I_BAPIRET2 LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
w_bapisdhd1-doc_type = 'TA'.
w_bapisdhd1-sales_org = '0001'.
w_bapisdhd1-distr_chan = '01'.
w_bapisdhd1-division = '01'.
i_bapipanr-partn_role = 'AG'.
i_bapipanr-partn_numb = '0000000011'.
append i_bapipanr.
i_bapisditm-MATERIAL = 'FLASK'.
append i_bapisditm.
*v_vbeln = '123'.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
SALESDOCUMENTIN = ''
ORDER_HEADER_IN = w_bapisdhd1
ORDER_HEADER_INX =
SENDER =
BINARY_RELATIONSHIPTYPE =
INT_NUMBER_ASSIGNMENT =
BEHAVE_WHEN_ERROR =
LOGIC_SWITCH =
TESTRUN =
CONVERT = ' '
IMPORTING
SALESDOCUMENT = V_VBELN
TABLES
RETURN = I_BAPIRET2
ORDER_ITEMS_IN = i_bapisditm
ORDER_ITEMS_INX =
ORDER_PARTNERS = i_bapipanr
ORDER_SCHEDULES_IN =
ORDER_SCHEDULES_INX =
ORDER_CONDITIONS_IN =
ORDER_CONDITIONS_INX =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CFGS_VK =
ORDER_CFGS_REFINST =
ORDER_CCARD =
ORDER_TEXT =
ORDER_KEYS =
EXTENSIONIN =
PARTNERADDRESSES =
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT =
IMPORTING
RETURN =
.
WRITE: / V_VBELN.
-
YouRgds Umakanth
‎2008 Jun 04 10:04 AM
Hi Aastha,
This is just a refernce code...Just check this out and c if it helps you in any way.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = T_HEAD
*CLIENTDATA =
*CLIENTDATAX =
PLANTDATA = T_MARC
PLANTDATAX = T_MARCX
*FORECASTPARAMETERS =
*FORECASTPARAMETERSX =
*PLANNINGDATA =
*PLANNINGDATAX =
STORAGELOCATIONDATA = T_MARD
STORAGELOCATIONDATAX = T_MARDX
*VALUATIONDATA =
*VALUATIONDATAX =
*WAREHOUSENUMBERDATA =
*WAREHOUSENUMBERDATAX =
*SALESDATA = T_MVKE
*SALESDATAX = T_MVKEX
*STORAGETYPEDATA =
*STORAGETYPEDATAX =
*FLAG_ONLINE = ' '
*FLAG_CAD_CALL = ' '
*NO_DEQUEUE = ' '
IMPORTING
RETURN = T_RETURN
*TABLES
*MATERIALDESCRIPTION =
*UNITSOFMEASURE =
*UNITSOFMEASUREX =
*INTERNATIONALARTNOS =
*MATERIALLONGTEXT =
*TAXCLASSIFICATIONS =
*RETURNMESSAGES =
*PRTDATA =
*PRTDATAX =
*EXTENSIONIN =
*EXTENSIONINX =
Make sure ur using the following statement after this bapi.
COMMIT WORK.
Thanks
Nayan
‎2008 Jun 04 10:39 AM
Hi Astha,
It's easy to understand which fields needs to passed by looking at documentation associated with each of the parameter.
Open the FM in SE37
This FM is used for both creation and updation of the materials into the system.
you need provide at least some basic vales such as material number (in case you are updating- you should pass material number)
for different view associated with material, it has different fields as mandatory
Such as for sales view you need to pass sales org, sales group
for Purchase view you need to pass pruchase org
Regards,
Amit R.