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

Update custom filed in AUFK?

Former Member
0 Likes
4,849

Hi all,

i added a custom date field for transaction IW31/32. The requiremnet is to update the same using bapi.

i have this bapi 'BAPI_ALM_ORDER_MAINTAIN'

and i followed this link http://scn.sap.com/thread/2136542.

yet the field is not getting updated using the standard bapi.

thnaks & regards

satish chandra

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
4,158

If you want to use BAdI IBAPI_ALM_ORD_MODIF, the fields must have been appended in in structure CI_AUFK or in appends both of table AUFK and of structure CAUFVTAB.

Regards,

Raymond

Hi all,

i added a custom date field for transaction IW31/32. The requiremnet is to update the same using bapi.

i have this bapi 'BAPI_ALM_ORDER_MAINTAIN'

and i followed this link http://scn.sap.com/thread/2136542.

yet the field is not getting updated using the standard bapi.

thnaks & regards

satish chandra

8 REPLIES 8
Read only

0 Likes
4,158

use CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' FM To Commit work

Regards,

Sinagam

Read only

RaymondGiuseppi
Active Contributor
0 Likes
4,159

If you want to use BAdI IBAPI_ALM_ORD_MODIF, the fields must have been appended in in structure CI_AUFK or in appends both of table AUFK and of structure CAUFVTAB.

Regards,

Raymond

Read only

0 Likes
4,158

Thanks for reply,

Pavan i am calling commit also.

Raymond the fields are also appended in the structures ci_aufk, caufvtab.

regards

satish chandra

Read only

0 Likes
4,158

Can you post your the pertinent code of

  • Filling EXTENSIONIN parameter
  • BAdI IBAPI_ALM_ORD_MODIF

Regards,

Raymond

Read only

0 Likes
4,158

 

DATA: Lr_HEADER_INT TYPE ALMB_CAUFVD.

DATA: Lr_HEADER_INT_UP TYPE IBAPI_CAUFVD_UPDATE. " added field in this structure lafd_ufd

READ TABLE CT_HEADER_INT INTO Lr_HEADER_INT

WITH KEY AUFNR = EXTENSION_IN-VALUEPART1+0(12).

IF SY-SUBRC = 0.

Lr_HEADER_INT-lafd = EXTENSION_IN-VALUEPART1+12(8). "set lafd value

MODIFY CT_HEADER_INT FROM Lr_HEADER_INT index SY-TABIX.

ELSE.

Lr_HEADER_INT-AUFNR = EXTENSION_IN-VALUEPART1+0(12).

Lr_HEADER_INT-lafd = EXTENSION_IN-VALUEPART1+12(8). "set lafd value

APPEND Lr_HEADER_INT TO CT_HEADER_INT.

ENDIF.

READ TABLE CT_HEADER_INT_UP INTO Lr_HEADER_INT_UP

WITH KEY AUFNR = EXTENSION_IN-VALUEPART1+0(12).

IF SY-SUBRC = 0. "set lafd value

Lr_HEADER_INT_UP-LAFD = 'X'. "set lafd flag

MODIFY CT_HEADER_INT_UP FROM Lr_HEADER_INT_UP index SY-TABIX.

ELSE.

Lr_HEADER_INT_UP-LAFD = 'X'.

APPEND Lr_HEADER_INT_UP TO CT_HEADER_INT_UP. "set lafd flag

ENDIF.

thanks & regards

satish chandra

Read only

0 Likes
4,158

it worked for me when i changed the custom field form LAFD to ZLAFD.

Thanks a Lot guys for your support.

Satish Chandra

Read only

4,158
In case somebody still looking for the answers,

1. BAPI_ALM_ORDER_MAINTAIN


for the structure EXTENSION_IN

STRUCTURE                      BAPI_TE_AUFK
VALUEPART1                     203000000001X2

value of Customfield1 = X
value of Customfield2 = 2

2.activate badi IBAPI_ALM_ORD_MODIF just like Raymond Giuseppi mentioned above.

3.you have to append structure IBAPI_CAUFVD_UPDATE manually reflecting to your custom fields in CI_AUFK with type BAPIUPDATE

4.In the method modify_input_data here the example code:

    CONSTANTS: co_bapi_te_aufk TYPE bapiparex-structure
VALUE 'BAPI_TE_AUFK'.

DATA: lw_aufk_custfield TYPE bapi_te_aufk.

CASE extension_in-structure.
WHEN co_bapi_te_aufk.
lw_aufk_custfield = extension_in-valuepart1.
ct_header_int = VALUE #(
( aufnr = lw_aufk_custfield-orderid
zzcustfield1 = lw_aufk_custfield-zzcustfield1
zzcustfield2 = lw_aufk_custfield-zzcustfield2 )
).

ct_header_int_up = VALUE #(
( aufnr = abap_true
zzcustfield1 = abap_true
zzcustfield2 = abap_true
)
).

WHEN OTHERS.
ENDCASE.
Read only

0 Likes
4,158

Hi Julius,

can you show the code written for bapi_alm_order_maintain.

am unable to get point 1.

Thanks, in advance.