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: 

HELP REQ IN BAPI_REQUISTION_CREATE

Former Member
0 Kudos

Hello

I am creating a reservation using Bapi_requistion_create.

I have everything working fine when the data passed is correct to bapi.

say storage location and plant for a mterial.

say i pass some wrong storage location, it won't create a reservation.

MY PROBLEM IS I DON'T WHAT IS THE WRONG INFORMATION(MEAN TO SAY I KNOW BUT THE USER DOESN'T KNOW)

SO MY QUESTION IS,

1)I HAVE TO CHECK EXTERNALLY MY SELF BEFORE PASSING THE DATA TO BAPI,

OR DOES PROVIDES WITH THE ERROR MESS.

IF THE BAPI PROVIDES WITH THE ERROR, I DON'T KNOW HOW TO RETRIEVE THIS MESS AND DISPLAY.

pLEASE HELP ME OUT.

THIS IS MY PIECE OF CODE

**header data

header-plant = PLANT.

header-res_date = sy-datum.

header-created_by = sy-uname.

header-cost_ctr = kostl.

header-move_type = '201'.

      • *ITEM DATA

loop at itab.

itab1-material = itab-matnr.

itab1-plant = PLANT.

itab1-store_loc = itab-lgort.

itab1-quantity = '7'.

itab1-unit = 'EA'.

append itab1.

clear itab1.

clear iTAB.

endloop.

CALL FUNCTION 'BAPI_RESERVATION_CREATE'

EXPORTING

RESERVATION_HEADER = header

  • NO_COMMIT =

  • MOVEMENT_AUTO =

IMPORTING

RESERVATION = no

TABLES

RESERVATION_ITEMS = itab1

RETURN = itab_bapi_return

.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = space

  • IMPORTING

  • RETURN =

.

if not no is initial.

write : / no.

endif.

THANKS

SWATHI

1 REPLY 1

Former Member
0 Kudos

HI,

If you want to Show the Errors, then we have a Table <b>RETURN</b>

CALL FUNCTION 'BAPI_RESERVATION_CREATE'

EXPORTING

RESERVATION_HEADER = header

  • NO_COMMIT =

  • MOVEMENT_AUTO =

IMPORTING

RESERVATION = no

TABLES

RESERVATION_ITEMS = itab1

<b>RETURN = itab_bapi_return</b>

This Internal table will contain all the data, Errors as well as Success.

Regards

Sudheer