cancel
Showing results for 
Search instead for 
Did you mean: 

I am using exit_saplkedrcopa_001 for enhancement to populate characteristics values in KEDR.

0 Kudos

When creating Sales order VA01 characteristics values is populating well but after saving the sales order they are empty or getting cleared....but in VA02 it's working fine after saving the same sales order it is populating and doesn't get clear...what can be the issue?

View Entire Topic
raymond_giuseppi
Active Contributor
0 Kudos

Some wrong code in include ZXKKEU11 ?

0 Kudos
But then it should not work entirely..characteristics values populate while creating sales order in VA01 but while saving they get clear.....but same sales order when opened in VA02 and in profitablity analysis we press deivation these fields get updated and when saved dont get clear...
raymond_giuseppi
Active Contributor
0 Kudos

that's why I suspect an error in the code that causes different behavior between creation and modification.
Of course, the error could be elsewhere, in one of the user-exits such as document save prepare, for example.

0 Kudos
DATA: ls_ce0vgoc TYPE ce0vgoc.
*
  CASE i_operating_concern.

    WHEN 'VGOC'.


      e_exit_is_active = 'X'.


      ls_ce0vgoc = i_copa_item.

      SELECT vbak~kunnr,
            vbap~matnr
       FROM vbak AS vbak
       INNER JOIN vbap AS vbap
       ON vbak~kunnr = vbap~kunnr_ana
       WHERE vbap~vkorg_ana = @LieneS_ce0vgoc-vkorg
       AND vbak~bukrs_vf = @LieneS_ce0vgoc-bukrs
       AND vbap~matnr = @LieneS_ce0vgoc-artnr
       AND vbak~kunnr = @LieneS_ce0vgoc-kndnr
       INTO TABLE @DATA(lt_matnr).

      IF sy-subrc EQ 0.
        SORT lt_matnr BY kunnr.

        DELETE ADJACENT DUPLICATES FROM lt_matnr COMPARING kunnr.
      ENDIF.

      IF lt_matnr IS NOT INITIAL.
        SELECT mcsh~name,
               mcsh~hname,
               mcsh~parent
            FROM mcshierb AS mcsh
            INNER JOIN @LT_matnr AS itab
            ON mcsh~name = itab~kunnr
            OR mcsh~name = itab~matnr
            INTO TABLE @DATA(lt_mcsh).

        IF sy-subrc EQ 0.
          SORT lt_mcsh BY hname.
          DELETE ADJACENT DUPLICATES FROM lt_mcsh COMPARING hname.
        ENDIF.

        SELECT mcsh~hname,
                       mcsh~id,
                       mcsh~name
                  FROM mcshierb AS mcsh
                  INNER JOIN @LT_mcsh AS itab
                  ON mcsh~id = itab~parent
                  AND mcsh~hname = itab~hname
                  INTO TABLE @DATA(lt_final).
      ENDIF.

      IF sy-subrc EQ 0.
        SORT lt_final BY hname.
        DELETE ADJACENT DUPLICATES FROM lt_final COMPARING hname.
      ENDIF.

      IF lt_final IS NOT INITIAL.
        LOOP AT lt_final ASSIGNING FIELD-SYMBOL(<lfs_final>).
          CASE <lfs_final>-hname.

            WHEN 'SE_PRODGRP'.

              ls_ce0vgoc-zzww101 = <lfs_final>-id.

            WHEN 'SE_PRODTYP'.

              ls_ce0vgoc-zzww102 = <lfs_final>-id.

            WHEN 'SE_CUSTGRP'.

              ls_ce0vgoc-zzww103 = <lfs_final>-id.

          ENDCASE.

        ENDLOOP.

      ENDIF.

      e_copa_item = ls_ce0vgoc.

  ENDCASE.
0 Kudos

Above is the code in ZXKKEU11