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

Passing values to BAPI's - pls help

Former Member
0 Likes
387

Hi,

I have some datas in z-table, I want to pass that datas to IW31 tr-code. I collected all BAPI's and I need help about How to call and Pass the values through BAPI. Pls help me.....

Thanks in Advance,

Sunil

Hi,

I have some datas in z-table, I want to pass that datas to IW31 tr-code. I collected all BAPI's and I need help about How to call and Pass the values through BAPI. Pls help me.....

Thanks in Advance,

Sunil

1 REPLY 1
Read only

Former Member
0 Likes
341

Hi!

It is an easy working one for me... Depending on your customizing, please change the hardcoded parts, like order type, and so on...

*&----


*

*& Report Z_BAPI_ALM_ORDER_MAINTAIN_TEST *

*& *

*&----


*

*& *

*& *

*&----


*

REPORT z_bapi_alm_order_maintain_test.

DATA: it_methods LIKE STANDARD TABLE OF bapi_alm_order_method,

wa_methods LIKE LINE OF it_methods.

DATA: it_header LIKE STANDARD TABLE OF bapi_alm_order_headers_i,

wa_header LIKE LINE OF it_header.

DATA: it_operation LIKE STANDARD TABLE OF bapi_alm_order_operation,

wa_operation LIKE LINE OF it_operation.

DATA: it_text LIKE STANDARD TABLE OF bapi_alm_text,

wa_text LIKE LINE OF it_text.

DATA: et_numbers LIKE STANDARD TABLE OF bapi_alm_numbers,

wa_numbers LIKE LINE OF et_numbers.

DATA: gt_return LIKE STANDARD TABLE OF bapiret2.

START-OF-SELECTION.

  • METHODS SECTION

MOVE '1' TO wa_methods-REFNUMBER.

MOVE 'HEADER' TO wa_methods-objecttype.

MOVE 'CREATE' TO wa_methods-method.

MOVE '%00000000001' TO wa_methods-objectkey.

INSERT wa_methods INTO TABLE it_methods.

MOVE '1' TO wa_methods-REFNUMBER.

MOVE 'OPERATION' TO wa_methods-objecttype.

MOVE 'CREATE' TO wa_methods-method.

MOVE '%000000000010010' TO wa_methods-objectkey.

INSERT wa_methods INTO TABLE it_methods.

MOVE '1' TO wa_methods-REFNUMBER.

MOVE '' TO wa_methods-objecttype.

MOVE 'SAVE' TO wa_methods-method.

MOVE '%00000000001' TO wa_methods-objectkey.

INSERT wa_methods INTO TABLE it_methods.

  • HEADER SECTION

MOVE '%00000000001' TO wa_header-orderid.

MOVE 'D210' TO wa_header-order_type.

MOVE '2000' TO wa_header-planplant.

MOVE '19' TO wa_header-mn_wk_ctr.

MOVE '2000' TO wa_header-plant.

MOVE 'CUV-SZV-CSUR-ATEM-I...' TO wa_header-funct_loc.

MOVE '' TO wa_header-equipment.

MOVE '' TO wa_header-material.

MOVE 'SAMPLE TEXT HEADER' TO wa_header-short_text.

INSERT wa_header INTO TABLE it_header.

  • OPERATION SECTION

MOVE '10' TO wa_operation-activity.

MOVE '' TO wa_operation-sub_activity.

MOVE '' TO wa_operation-standard_text_key.

MOVE 'SAMPLE TEXT OPERATION' TO wa_operation-description.

MOVE '' TO wa_operation-vendor_no.

MOVE 3 TO wa_operation-quantity.

MOVE 'KG' TO wa_operation-base_uom.

INSERT wa_operation INTO TABLE it_operation.

REFRESH et_numbers.

CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'

TABLES

it_methods = it_methods

it_header = it_header

  • IT_HEADER_UP =

  • IT_HEADER_SRV =

  • IT_HEADER_SRV_UP =

  • IT_USERSTATUS =

  • IT_PARTNER =

  • IT_PARTNER_UP =

it_operation = it_operation

  • IT_OPERATION_UP =

  • IT_RELATION =

  • IT_RELATION_UP =

  • IT_COMPONENT =

  • IT_COMPONENT_UP =

  • IT_TEXT = it_text

  • IT_TEXT_LINES =

  • EXTENSION_IN =

RETURN = gt_return

et_numbers = et_numbers

.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

  • CHECK GT_RETURN FOR POSSIBLE FAILURES

Regards

Tamá