AT NEW statement
Hi everyone,
I would like to move/append a line from 1 internal table (DTAB_ISSUE) for every 1st occurance of a new material number (MATNR). Based on my logic below, it did manage move the first line correctly to my target internal table (DTAB) but for some reason, the first field which is DTAB-MATNR contains the material number, but the other fields all get asterisks (*)...why?
I declared my tables as follows:
DATA: BEGIN OF DTAB OCCURS 0, MATNR LIKE AUFM-MATNR, "Material Number MBLNR LIKE AUFM-MBLNR, "Number of Material Document BUDAT LIKE AUFM-BUDAT, "Posting Date in the Document BWART LIKE AUFM-BWART, "Movement Type CHARG LIKE AUFM-CHARG, "Batch Number WERKS LIKE AUFM-WERKS, "Plant END OF DTAB. DATA: BEGIN OF DTAB_ISSUE OCCURS 0, MATNR LIKE AUFM-MATNR, "Material Number MBLNR LIKE AUFM-MBLNR, "Number of Material Document BUDAT LIKE AUFM-BUDAT, "Posting Date in the Document BWART LIKE AUFM-BWART, "Movement Type CHARG LIKE AUFM-CHARG, "Batch Number WERKS LIKE AUFM-WERKS, "Plant END OF DTAB_ISSUE. *--> Select statement to fill up DTAB_ISSUE SORT DTAB_ISSUE BY MATNR MBLNR DESCENDING. LOOP AT DTAB_ISSUE. AT NEW MATNR. WRITE DTAB_ISSUE TO DTAB. APPEND DTAB. ENDAT. ENDLOOP.
Is there a way to make the values for the fields after DTAB-MATNR to appear as it suppose to?
Tags:
Former Member replied
Hi bernard,
1. U are right.
2. We get **** in other fields.
3. So instead of AT NEW
4. <b>use ON CHANGE event.</b>
5. In this case, u will not get ****
but u will get the other fields of that particular row
on which the event fires.
regards,
amit m.