‎2008 May 15 11:47 AM
i have written the following code
LOOP AT gt_ekpo WHERE ebeln NE ' '.
MOVE gt_ekpo-ebeln TO gt_final-ebeln.
MOVE gt_ekpo-matnr TO gt_final-matnr.
READ TABLE gt_mara WITH KEY matnr = gt_ekpo-matnr BINARY SEARCH.
IF sy-subrc = 0.
MOVE gt_mara-bismt TO gt_final-bismt.
ENDIF.
READ TABLE gt_equi WITH KEY matnr = gt_ekpo-matnr BINARY SEARCH.
IF sy-subrc = 0.
MOVE gt_equi-invnr TO gt_final-invnr.
MOVE gt_equi-sernr TO gt_final-sernr.
ENDIF.
APPEND gt_final.
clear gt_final.
the problem is i am comparing all the fields with matnr and reading the remaing fields.
if matnr field is empty, then all the remaing fields are also empty except ebeln.
then when matnr is empty it should not display in the output.
please help me how to write code for this.
‎2008 May 15 11:51 AM
if so,
then delete the entries from internal table if matnr is empty.
if you cant do that...then add the condition
LOOP AT gt_ekpo WHERE ebeln NE ' ' and matnr ne ''.
regards,
madhumitha
‎2008 May 15 11:51 AM
Hi,
Add the condition "check gt_ekpo-matnr ne space", immediatley after the loop as shown in the below code.
LOOP AT gt_ekpo WHERE ebeln NE ' '.
*******
check gt_ekpo-matnr ne space.
*******
MOVE gt_ekpo-ebeln TO gt_final-ebeln.
MOVE gt_ekpo-matnr TO gt_final-matnr.
READ TABLE gt_mara WITH KEY matnr = gt_ekpo-matnr BINARY SEARCH.
IF sy-subrc = 0.
MOVE gt_mara-bismt TO gt_final-bismt.
ENDIF.
READ TABLE gt_equi WITH KEY matnr = gt_ekpo-matnr BINARY SEARCH.
IF sy-subrc = 0.
MOVE gt_equi-invnr TO gt_final-invnr.
MOVE gt_equi-sernr TO gt_final-sernr.
ENDIF.
APPEND gt_final.
clear gt_final.
Regards,
Satya
‎2008 May 15 11:52 AM
LOOP AT gt_ekpo WHERE ebeln NE ' '.
if gt_ekpo-matnr = ' '.
CONTINUE.
ELSE.
MOVE gt_ekpo-ebeln TO gt_final-ebeln.
MOVE gt_ekpo-matnr TO gt_final-matnr.
READ TABLE gt_mara WITH KEY matnr = gt_ekpo-matnr BINARY SEARCH.
IF sy-subrc = 0.
MOVE gt_mara-bismt TO gt_final-bismt.
ENDIF.
READ TABLE gt_equi WITH KEY matnr = gt_ekpo-matnr BINARY SEARCH.
IF sy-subrc = 0.
MOVE gt_equi-invnr TO gt_final-invnr.
MOVE gt_equi-sernr TO gt_final-sernr.
ENDIF.
APPEND gt_final.
clear gt_final.
ENDIF.
ENDLOOP.
CHECK THE ABOVE CODE AND TRY.
Regards,
Madan.
‎2008 May 15 11:56 AM