Skip to Content
author's profile photo Former Member
Former Member

Problem to add 'Possible Hazards' property

Hi all,

I use this code to add possible hazards properties.

 CLEAR l_prop_header_wa.
    header_primkey = header_primkey + 1.
    l_prop_header_wa-primarykey  = header_primkey. "int. key
    l_prop_header_wa-flgprimkey  = abap_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-subchacat   = 'SAP_EHS_1011_001'. " POSSIBLE_HAZARDS
    APPEND l_prop_header_wa TO l_prop_header_tab.

        LOOP AT lt_estpp INTO ls_estpp.

      SELECT * FROM  estpp INTO estpp_wa
        WHERE  langu     = sy-langu
        AND    phrtext   = ls_estpp-phrtext.
        SELECT        * FROM  estph INTO estph_wa
               WHERE  recn  = estpp_wa-recnroot.
          CONCATENATE estph_wa-catpin '-' estph_wa-phrid INTO l_prop_data_wa-char_value.

*   prepare the VALUE tab

          CLEAR l_prop_val_wa.
          val_primkey = val_primkey + 1.
          l_prop_val_wa-primarykey  = val_primkey.
          l_prop_val_wa-flgprimkey  = abap_true.
          l_prop_val_wa-foreignkey  = l_prop_header_wa-primarykey.
          l_prop_val_wa-flgfrgnkey  = l_prop_header_wa-flgprimkey.
*          l_prop_val_wa-sequence    = 1.
          APPEND l_prop_val_wa TO l_prop_val_tab.

          CLEAR l_prop_data_wa.
          data_primkey = data_primkey + 1.
          l_prop_data_wa-primarykey  = data_primkey.
          l_prop_data_wa-flgprimkey  = abap_true.
          l_prop_data_wa-foreignkey  = l_prop_val_wa-primarykey.
          l_prop_data_wa-flgfrgnkey  = l_prop_val_wa-flgprimkey.
          l_prop_data_wa-name_char   = 'SAP_EHS_1011_001_ADVICE'.
          l_prop_data_wa-oper_inc    = 0.
          APPEND l_prop_data_wa TO l_prop_data_tab.

          CLEAR l_prop_data_wa.


I don't know why it doesn't work.

When i call the bapi 'BAPI_BUS1077_CREATE', I have no error message.

But when i check within CG02 transaction i have nothing.

I mean i have a new entry but there is no new "Possible Hazards" property.

Does someone see an error in this code ?

Thanks in advance for your help.

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 13, 2011 at 08:55 AM

    Hi experts,

    Anyone can help me please to resolve this issue or can send me or post an example of source code doing this to compare it with mine.


    Add comment
    10|10000 characters needed characters exceeded

    • Hello

      as explained in thread:

      add a "flash point" property using "BAPI_BUS1077_CREATE".

      there are a number of OSS notes available. OSS notes are not always corrections of code but sometimes they gives recommendattions etc. To get acces to these notes you need only the so called "S User" which you can get easily. One of the OSS notes mentioned there (in the thread) contains I belive three or four SAP reports giving examples how to use the BAPIS correct.

      This special OSS note is

      a.) a consulting note

      b.) and at these same time you can get some transports with the reports

      Give them a try. They should help you to understand how to use the BAPIs.