Application Development and Automation 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: 
Read only

Bapi

Former Member
0 Likes
578

Hi ,

Am calling a user defined BAPI in my report , its returning an error message before comitting the data.

need suggestion how to rectify the error , i mean wht r the things i need to check , do i need to check the parameters tht r passed to the user defined bapi ?

The user defined bapi code is :

CALL FUNCTION '/zkg/WB_ALLOCATION'

EXPORTING

i_material = itab_display_matnr

i_batch = itab_display_charg1

i_plant = itab_display_werks

i_alloc_flag = p_all

  • I_LOCK_CHECK = 1

i_vbeln = itab_display_vbeln

i_posnr = itab_display_posnr

i_sloc = itab_display_lgort

i_clabs = itab_display_clabs

TABLES

et_return = w_bapiret2

  • ET_DOC_INFO =

  • CHANGING

  • I_COMPLETE =

.

READ TABLE w_bapiret2 INTO wa_bapiret2 WITH KEY type = 'E'.

IF sy-subrc = 0.

  • output the error message

CLEAR okcode.

MESSAGE e100(pp) WITH wa_bapiret2-message.

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = g_bwait

IMPORTING

return = gt_bapiret2.

ENDIF.

thxs,

vind.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
550

Hi,

Check in the Debug mode where the error gets set.

Then accordingly you can change what is passed to the BAPI. Or change the BAPI code.

Sameena

Message was edited by: sameena attarwala

3 REPLIES 3
Read only

Former Member
0 Likes
551

Hi,

Check in the Debug mode where the error gets set.

Then accordingly you can change what is passed to the BAPI. Or change the BAPI code.

Sameena

Message was edited by: sameena attarwala

Read only

Former Member
0 Likes
550

what is the message that you are getting?

Read only

Former Member
0 Likes
550

Hi,

I suppose you need to check your BAPI. Put a break-point in your BAPI to check whether data input to BAPI is in appropriate format or not. This will also give you a clear picture of where the problem is occuring, I mean the code in your BAPI that is generating error. We will then be able to find the solution.

Regards,

Reema.