‎2007 Feb 20 10:37 PM
Hi ,
I am trying write a program to retieve a file from unix to sap that contains F1 & F2.
This prg must read the file and do a call transaction to update the del(likp-bolnr)with F2 and update the status table even.
For this I need to use selection screen.
Anyone help me with code Please.
Thanks
‎2007 Feb 20 11:09 PM
Hi,
I am not clear with your question..
Do you want to have a file path parameter in the selection-screen..
Check this program to read the file from the unix..
PARAMETERS: p_file(100).
DATA: BEGIN OF itab OCCURS 0,
f1(10),
f2 LIKE likp-bolnr,
END OF itab.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
OPEN DATASET p_file.
IF sy-subrc = 0.
DO.
READ DATASET p_file INTO itab.
IF sy-subrc <> 0.
EXIT.
ELSE.
APPEND itab.
CLEAR itab.
ENDIF.
ENDDO.
ENDIF.
CLOSE DATASET p_file.
Process the internal table.
LOOP AT itab.
Build the BDC data.
CALL TRANSACTION 'VL02' USING bdcdata MODE 'N'.
IF sy-subrc <> 0.
WRITE: / 'Delivery not updated'.
ENDIF.
ENDLOOP.
Thanks,
Naren
‎2007 Feb 20 11:09 PM
Hi,
I am not clear with your question..
Do you want to have a file path parameter in the selection-screen..
Check this program to read the file from the unix..
PARAMETERS: p_file(100).
DATA: BEGIN OF itab OCCURS 0,
f1(10),
f2 LIKE likp-bolnr,
END OF itab.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
OPEN DATASET p_file.
IF sy-subrc = 0.
DO.
READ DATASET p_file INTO itab.
IF sy-subrc <> 0.
EXIT.
ELSE.
APPEND itab.
CLEAR itab.
ENDIF.
ENDDO.
ENDIF.
CLOSE DATASET p_file.
Process the internal table.
LOOP AT itab.
Build the BDC data.
CALL TRANSACTION 'VL02' USING bdcdata MODE 'N'.
IF sy-subrc <> 0.
WRITE: / 'Delivery not updated'.
ENDIF.
ENDLOOP.
Thanks,
Naren
‎2007 Feb 21 1:08 AM