Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

selection screen

Former Member
0 Likes
293

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
275

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

2 REPLIES 2
Read only

Former Member
0 Likes
276

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

Read only

0 Likes
275

Yes I wanted SS for file path ...Thank you Naren