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: 

BAPI problem

Former Member
0 Kudos

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.

3 REPLIES 3

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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