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

Output file Modification

Former Member
0 Likes
350

Hi I need some clarification on the below code …..The input file is P_FILE1 .

I need to add one validation – like

If input file name is ABC_A then output file should be ABC_A_Current date.

If input file name is XYZ_X then output file should be XYZ_X _Current date .

Please suggest how I will do it .

CONCATENATE P_PATH1 P_FILE1 INTO PATH_FILE1.

CONCATENATE P_PATH2 P_FILE2 SY_DATUM INTO PATH_FILE2.

OPEN DATASET PATH_FILE2 FOR OUTPUT IN TEXT MODE.

OPEN DATASET PATH_FILE1 FOR INPUT IN TEXT MODE.

IF SY-SUBRC <> 0.

WRITE:/ 'UNABLE TO OPEN EXTRACT FILE'.

EXIT.

ELSE.

DO.

READ DATASET PATH_FILE1 INTO ITAB.

IF SY-SUBRC <> 0.

EXIT.

ELSE.

ADD 1 TO INPUT_CNT.

SPLIT ITAB AT SV_DELIMIT

INTO ITAB- EBELN .

2 REPLIES 2
Read only

Former Member
0 Likes
327

Hello,

Use the FM PC_SPLIT_COMPLETE_FILENAME to get the file name alone

then write:

CONCATENATE P_PATH1 P_FILE1 '_' sy-datum INTO PATH_FILE2.

write: PATH_FILE2

Regards,

Vasanth

Read only

0 Likes
327

Hi Vasanth ,

I didn't find any FM called " PC_SPLIT_COMPLETE_FILENAME " . Is there any other way to solve the problem . Where i will do the changes .

Regds

Sabyasachi