11-16-2005 9:25 PM
hi,
i need to have a routine in the external data tab -> infopackage , so that the routine takes changes the file in the external data tab with respect to the month. can any body help me with this as i have no idea about the routines. the file naems are similar to each other in all ways except that the month on the file name is different.
please some body help me by giving the entire program. help needed immidiately.
points will be fully rewarded.
Thanx,
Ravi.
Message was edited by: ravi kalidindi
11-16-2005 10:24 PM
Ravi - I'm not sure what you are trying to do.
Do you have files on the application or presentation server with the month in the file name? And are you trying to change the file name?
Rob
11-17-2005 1:28 AM
hi,
yes i want to change the month name after every month.
thanx.
Ravi.
11-17-2005 2:01 AM
Ravi , check if this code is useful for you.
IF NOT i_itab[] IS INITIAL.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = SY-LANGU
IMPORTING
RETURN_CODE =
TABLES
MONTH_NAMES = itab_month
EXCEPTIONS
MONTH_NAMES_NOT_FOUND = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE itab_month
WITH KEY MNR = sy-datum+4(2).
CONCATENATE p_file itab_month-ltx '.TXT' INTO p_file.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE.
IF NOT i_itab[] IS INITIAL.
LOOP AT itab_out.
TRANSFER itab_out TO p_file.
ENDLOOP.
IF sy-subrc = 0.
MESSAGE s398(00) WITH p_file(25) 'created on Unix server'.
ELSE.
MESSAGE e398(00) WITH p_file(25) 'cannot be created'.
ENDIF.
ENDIF.