07-23-2009 12:19 PM
hi,
in bapi BAPI_MATERIAL_SAVEDATA
iam getting allthe views with correct data except mrp view ,
costview , accountingview can anyone tell me why its happening.
07-23-2009 12:23 PM
Hi,
The BAPI returns two types of messages:
- EXPORTING parameter RETURN (holds last message of RETURNMESSAGES)
- TABLES parameter RETURNMESSAGES
Now check the RETURNMESSAGES for details about the problems:
DATA:
ls_return TYPE bapi_matreturn2.
lt_returnmessages TYPE STANDADRD TABLE OF bapi_matreturn2.
" Retrieve the return messages into lt_returnmessages
LOOP AT lt_returnmessages into ls_return
WHERE ( type CA 'AEX' ). " abort, error, dump
" debug here and check the error details
ENDLOOP.
Please let me know the message in return table
Edited by: ShreeMohan Pugalia on Jul 23, 2009 1:26 PM
07-23-2009 12:25 PM
Hi ,
Try to put break-point in the function module & check out once.u ll get where exaclty problem is.
For mrp view,........etc is there data? if yes ,debug it.
regards,
pravin
07-24-2009 7:10 AM
hi chin Huan,
You have to check the table T_RETURN after, you called the BAPI, but before the commit.
If you see "E" or "A" TYPE messages in it, you have to solve these errors. After this, your material will be saved.
Set a break point into your code.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA' ...
BREAK-POINT. "or BREAK username.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
When your program has stopped at the breakpoint, you can check the vaues, what the T_RETURN table contains.
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
and for more information about the code you can refer to the below wiki link as reference
https://wiki.sdn.sap.com/wiki/display/sandbox/Programforcreating+materialusing++BAPI_MATERIAL_SAVEDATA
Regards
Saurabh Goel