cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Problem to add a composition using "BAPI_BUS1077_CREATE"

Former Member
0 Kudos

Hi ,

Is there anyone to help me to resolve this problem please ?

I try to add a new substance and its composition.

But In my database only the header and the identifiers of the new substance are stored.

But not the composition.

I thnik i know where is the problem : here is the code that i think is bad.

WC_CLASSE = 'SAP_EHS_1012_003'. " Legal Composition = STD
 
 
*   prepare the PROPERTY HEADER
    REFRESH: l_prop_header_tab, l_prop_header_tab_xp.
    CLEAR l_prop_header_wa.
    l_prop_header_wa-primarykey  = 1.         "int. key
    l_prop_header_wa-flgprimkey  = true.
*   l_prop_header_wa-foreignkey  = l_sub_header_wa-primarykey.
*   l_prop_header_wa-flgfrgnkey  = l_sub_header_wa-flgprimkey.
    l_prop_header_wa-foreignkey  = l_spec_recn.     
    l_prop_header_wa-flgfrgnkey  = false            
    l_prop_header_wa-subchacat   = WC_CLASSE.
    APPEND l_prop_header_wa TO l_prop_header_tab.

In this example l_spec_recn is empty.

And probably that i need to reference the sub_header-record_no as l_prop_header_wa-foreignkey.

But how can i do all this in one time.

Do i have to do a first call to Bapi_Bus1077_create with only sub_header and after do a "bapi_bus1077_get_detail".

And retreive the record_no ?

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

The error was found.

It was the flags' value, that were "T" instead of "X".

So it couldn't work.