Skip to Content

Debug problem for standard datasource in cmod

I wanted to use standard data source and I had to write cmod; I wanted to fill the zzmaktx area;

the result does not return when I want to debug rsa3

WHEN '0MATERIAL_ATTR'.

DATA: s_BIW_MARA_S TYPE BIW_MARA_S.

DATA: BEGIN OF gt_makt OCCURS 0,

MATNR TYPE MAKT-MATNR,
MAKTX TYPE MAKT-MAKTX,

END OF gt_makt.

select a~MATNR a~MAKTX
from makt as a
into table gt_makt.

sort gt_makt by MATNR.

LOOP AT c_t_data INTO s_BIW_MARA_S.

READ TABLE gt_makt WITH KEY MATNR = s_BIW_MARA_S-MATNR BINARY SEARCH.

IF sy-subrc EQ 0.

s_BIW_MARA_S-zzmaktx = gt_makt-MAKTX.

ENDIF.

MODIFY c_t_data FROM s_BIW_MARA_S.

ENDLOOP.


Add comment
10|10000 characters needed characters exceeded

  • You may have to use TRANSPORTING <field1>. But rather using MODIFY you can use field-symbol

    FIELD-SYMBOLS: 
      <lw_biw_mara_s> TYPE biw_mara_s,
      <lw_makt>       TYPE ty_makt.
    
    LOOP AT c_t_data ASSIGNING <lw_biw_mara_s>.
      READ TABLE lt_makt ASSIGNING <lw_makt> WITH KEY MATNR = s_BIW_MARA_S-MATNR 
        IF sy-subrc EQ 0.
          <lw_biw_mara_s>-zzmaktx = <lw_makt>-maktx.
        ENDIF.
    ENDLOOP.

    Instead of OCCURS, create a structure and create a SORTED table.

    You no need to specify alias name (a~) in the SELECT query but you have to use FOR ALL ENTRIES to get the materials based on C_T_DATA table.

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 23, 2018 at 04:01 PM

    This means that your break-point is not reached. Try to set it at a higher level to find why (the highest level being the function module EXIT_SAPLRSAP_001).

    Regards,

    Frédéric

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 23, 2018 at 02:46 PM

    Thank you so much for this answer,

    but even though I put the breakpoint it doesnt fall the debug. I dont have any problem with code.

    Add comment
    10|10000 characters needed characters exceeded