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

EH&S functionality - Need to change header specification details

Former Member
0 Likes
1,323

Hi,

My requirement is to change the VAL_AREA property of substance.

Details:

I am using BAPI_BUS1077_GETDETAIL to get all specification data of substance.

Then i am getting my required field i.e. val_area in PROP_USAGE table.

Then i have changed the field value and modified the PROP_USAGE table.

Now my requirement is how to pass this table to BAPI_BUS1077_CHANGE so that modified new value of val_area will be updated in cg02 transaction. I have also provided the change number in both the BAPI call

Thanks for the help.

Regards,

rachna

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,116

Yes, I have checked the flag. But dont know where its going wrong.

Here is my code .

DATA:RETURN LIKE standard table of BAPIRET2,

SUB_HEADER LIKE standard table of BAPI1077RH,

wa_sub_header LIKE BAPI1077RH,

PROP_HEADER LIKE standard table of BAPI1077VH,

wa_prop_header like BAPI1077VH,

PROP_VAL LIKE standard table of BAPI1077VA,

wa_PROP_VAL LIKE BAPI1077VA,

PROP_DATA LIKE standard table of BAPI1077PR,

PROP_COMPONENT LIKE standard table of BAPI1077VP,

PROP_USAGE LIKE standard table of BAPI1077DU,

wa_PROP_DATA LIKE BAPI1077PR,

wa_PROP_COMPONENT LIKE BAPI1077VP,

wa_PROP_USAGE LIKE BAPI1077DU.

break v738151.

wa_sub_header-substance = '000000328553'.

append wa_sub_header to sub_header.

.

call function 'BAPI_BUS1077_GETDETAIL'

exporting

scenario = '00'

  • KEY_DATE = SY-DATUM

CHANGE_NUMBER = '500000000340'

FLG_HEADER = 'X'

FLG_HEADER_USAGE = 'X'

FLG_PROPERTIES = 'x'

FLG_PROP_DATA = 'X'

FLG_PROP_DETAILS = 'X'

  • IMPORTING

  • FLG_ABORT_ON_ERROR =

tables

return = return

SUB_HEADER = sub_header

PROP_HEADER = PROP_HEADER

  • PROP_VAL = PROP_VAL

PROP_DATA = PROP_DATA

  • PROP_COMPONENT = PROP_COMPONENT

PROP_USAGE = PROP_USAGE

  • PROP_RELIABILITY =

.

loop at PROP_USAGE into wa_PROP_USAGE.

wa_prop_usage-val_area = 'TIM'.

MODIFY PROP_USAGE FROM WA_PROP_USAGE.

endloop.

CALL FUNCTION 'BAPI_BUS1077_CHANGE'

EXPORTING

KEY_DATE = SY-DATUM

CHANGE_NUMBER = '500000000340'

FLG_HEADER = 'X'

FLG_PROP_USAGE = 'X'

  • IMPORTING

  • FLG_ABORT_ON_ERROR =

TABLES

RETURN = return

SUB_HEADER = sub_header

SUB_HEADERX = sub_header

PROP_USAGE = PROP_USAGE

PROP_USAGEX = PROP_USAGE

.

Hi,

My requirement is to change the VAL_AREA property of substance.

Details:

I am using BAPI_BUS1077_GETDETAIL to get all specification data of substance.

Then i am getting my required field i.e. val_area in PROP_USAGE table.

Then i have changed the field value and modified the PROP_USAGE table.

Now my requirement is how to pass this table to BAPI_BUS1077_CHANGE so that modified new value of val_area will be updated in cg02 transaction. I have also provided the change number in both the BAPI call

Thanks for the help.

Regards,

rachna

5 REPLIES 5
Read only

Former Member
0 Likes
1,116

Are you passing value 'X' to the bapi import parameter "FLG_PROP_USAGE" ? In addition to this you have to fill the internal table structure "PROP_USAGEX" with required data. Read BAPI documentation for more details.

Read only

Former Member
0 Likes
1,117

Yes, I have checked the flag. But dont know where its going wrong.

Here is my code .

DATA:RETURN LIKE standard table of BAPIRET2,

SUB_HEADER LIKE standard table of BAPI1077RH,

wa_sub_header LIKE BAPI1077RH,

PROP_HEADER LIKE standard table of BAPI1077VH,

wa_prop_header like BAPI1077VH,

PROP_VAL LIKE standard table of BAPI1077VA,

wa_PROP_VAL LIKE BAPI1077VA,

PROP_DATA LIKE standard table of BAPI1077PR,

PROP_COMPONENT LIKE standard table of BAPI1077VP,

PROP_USAGE LIKE standard table of BAPI1077DU,

wa_PROP_DATA LIKE BAPI1077PR,

wa_PROP_COMPONENT LIKE BAPI1077VP,

wa_PROP_USAGE LIKE BAPI1077DU.

break v738151.

wa_sub_header-substance = '000000328553'.

append wa_sub_header to sub_header.

.

call function 'BAPI_BUS1077_GETDETAIL'

exporting

scenario = '00'

  • KEY_DATE = SY-DATUM

CHANGE_NUMBER = '500000000340'

FLG_HEADER = 'X'

FLG_HEADER_USAGE = 'X'

FLG_PROPERTIES = 'x'

FLG_PROP_DATA = 'X'

FLG_PROP_DETAILS = 'X'

  • IMPORTING

  • FLG_ABORT_ON_ERROR =

tables

return = return

SUB_HEADER = sub_header

PROP_HEADER = PROP_HEADER

  • PROP_VAL = PROP_VAL

PROP_DATA = PROP_DATA

  • PROP_COMPONENT = PROP_COMPONENT

PROP_USAGE = PROP_USAGE

  • PROP_RELIABILITY =

.

loop at PROP_USAGE into wa_PROP_USAGE.

wa_prop_usage-val_area = 'TIM'.

MODIFY PROP_USAGE FROM WA_PROP_USAGE.

endloop.

CALL FUNCTION 'BAPI_BUS1077_CHANGE'

EXPORTING

KEY_DATE = SY-DATUM

CHANGE_NUMBER = '500000000340'

FLG_HEADER = 'X'

FLG_PROP_USAGE = 'X'

  • IMPORTING

  • FLG_ABORT_ON_ERROR =

TABLES

RETURN = return

SUB_HEADER = sub_header

SUB_HEADERX = sub_header

PROP_USAGE = PROP_USAGE

PROP_USAGEX = PROP_USAGE

.

Read only

0 Likes
1,116

while calling bapi 'BAPI_BUS1077_CHANGE', you are passing wrong values to internal table structure PROP_USAGEX (passing same values to internal tables PROP_USAGE & PROP_USAGEX). PROP_USAGEX should be filled with FLAG (Update Flag) and MSGFN (Type of Updation). See the Documentation/Longtext of these parameters to get the details.

Read only

0 Likes
1,116

hi Vinod,

Thanks for your help. But i am not able to find out these parameters

Will be thankful if you help with the sample code also.

Read only

0 Likes
1,116

hi Vinod ,

Got your point. Its working now. Thanks for the help.

Regards,

Rachna