‎2007 May 07 9:44 AM
Hi everybody,
I am new to SDN and new to SAP also.
My first job is outbound interface.
i have one server SAP from which i have to transfer data to the PARK ftp server.
In the specifiaction it is given like the SAP will send via secure FTP (ssh protocol version 2.0) flat files containing information such as costs, events, options and cost options. The files will have to be sent in binary mode and will have to be encoded with UTF-8 encoding.
<u>FTP specifics are given as below.</u>
FTP PARK 3.0 server name - MK4F345678
ftp park 3.0 logical host name - xx.com
ftp park 3.0 ip adress - yy
ftp park 3.0 port number to be used - 22
ftp paark 3.0 ftp directory - <hh/jj/kk
could someone plz explaiin me how and i should proceed furthur to work on this job.
regards,
VRIT
‎2007 May 07 10:04 AM
hi,
chk out these links ,
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/72/c18ee5546a11d182cc0000e829fbfe/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/72/c18ee5546a11d182cc0000e829fbfe/frameset.htm</a>
‎2007 May 07 10:04 AM
hi,
chk out these links ,
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/72/c18ee5546a11d182cc0000e829fbfe/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/72/c18ee5546a11d182cc0000e829fbfe/frameset.htm</a>
‎2007 May 07 10:15 AM
I s this link helpful for me ?
friends is there any solution for this ?
Regards,
VRIT
Message was edited by:
VR IT
‎2007 May 07 11:20 AM
first create a destination in SM59 tcode , give ur host name or ip address , system number etc.
‎2007 May 07 11:30 AM
Thank you.
can u please clarify my doubt here PORT-22 is also given .
this means do i need to work on IDOCs or not neede..
If you could please send me any sample sample code very much related .
Regards,
VRIT.
‎2007 May 07 11:39 AM
goto tcode WE21 there create a port with tht name & specify the directory name, in the outbound:trigger specify the destination which u created in SM59.
‎2007 May 07 11:53 AM
Thank you.
Then how does the code should look like for this interface .
Actually i ahve to transfer four files .
I fi get the code for one file i can do the rest .
Could u provide me sample code which is very much helpful for me .
regards,
VRIT.
‎2007 May 07 1:10 PM
Hi,
<b>Is the below code close to my requirement.</b>
TABLES : ZISFP03.
CONSTANTS: C_DELIMETER(1) TYPE C
VALUE '#'.
TYPES: BEGIN OF TY_FREIGHT,
VENDOR TYPE ZISFP03-VENDOR,
LR_NO TYPE ZISFP03-LR_NO,
EBELN TYPE ZISFP03-EBELN,
LR_DATE TYPE ZISFP03-LR_DATE,
PO_DATE TYPE ZISFP03-PO_DATE,
PO_BRANCH TYPE ZISFP03-PO_BRANCH,
TRK_NO TYPE ZISFP03-TRK_NO,
DISP_TIME TYPE ZISFP03-DISP_TIME,
SCAN_NO TYPE ZISFP03-SCAN_NO,
ACTU_QTY TYPE ZISFP04-ACTU_QTY,
MATERIAL TYPE ZISFP04-MATERIAL,
GR_BRANCH TYPE ZISFP04-GR_BRANCH,
STDTIME TYPE ZISFP14-STDTIME,
EST_ARRV_DT TYPE ZISFP04-ARRV_DT,
END OF TY_FREIGHT.
TYPES: BEGIN OF TY_FTP,
FIELD(90) TYPE C,
END OF TY_FTP.
DATA: IT_FREIGHT TYPE STANDARD TABLE OF TY_FREIGHT,
IT_OUTPUT TYPE STANDARD TABLE OF TY_FREIGHT,
IT_FTP TYPE STANDARD TABLE OF TY_FTP.
DATA : BEGIN OF TABL OCCURS 0,
LINE(560),
END OF TABL.
DATA: WA_FREIGHT TYPE TY_FREIGHT,
WA_OUTPUT TYPE TY_FREIGHT,
WA_FTP TYPE TY_FTP.
DATA: W_DSN TYPE SXPGCOLIST-PARAMETERS,
W_FTP_DSN TYPE SXPGCOLIST-PARAMETERS,
W_PARCOM_LOC(150) TYPE C,
W_FNAME(16) TYPE C,
W_ERROR_FLAG(1) TYPE C.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_LR_DT FOR ZISFP03-LR_DATE.
SELECTION-SCREEN END OF BLOCK B1.
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM TRANSFER_DATA_TO_FILE.
PERFORM FTP_TRANSFER.
&----
*& Form GET_DATA
&----
text
----
FORM GET_DATA.
SELECT A~VENDOR
A~LR_NO
A~EBELN
A~LR_DATE
A~PO_DATE
A~PO_BRANCH
A~TRK_NO
A~DISP_TIME
A~SCAN_NO
B~ACTU_QTY
B~MATERIAL
B~GR_BRANCH
C~STDTIME
INTO TABLE IT_FREIGHT
FROM ( ( ZISFP03 AS A
INNER JOIN ZISFP04 AS B
ON AVENDOR = BVENDOR
AND ALR_NO = BLR_NO
AND AEBELN = BEBELN )
INNER JOIN ZISFP14 AS C
ON AVENDOR = CVENDOR
AND APO_BRANCH = CFROM_LOC
AND BGR_BRANCH = CTO_LOC
AND AZMODE = CEXPRES_TY )
WHERE A~LR_DATE IN S_LR_DT.
IF SY-SUBRC EQ 0.
SORT IT_FREIGHT BY VENDOR LR_NO EBELN.
DELETE ADJACENT DUPLICATES FROM IT_FREIGHT.
ENDIF.
IT_OUTPUT[] = IT_FREIGHT[].
ENDFORM. " GET_DATA
&----
*& Form TRANSFER_DATA_TO_FILE
&----
text
----
FORM TRANSFER_DATA_TO_FILE.
MOVE 'createnew.txt' TO W_FNAME.
CONCATENATE '/usr/sap/trans/mmpp/' W_FNAME INTO W_DSN.
OPEN DATASET W_DSN FOR OUTPUT IN TEXT MODE.
IF SY-SUBRC NE 0.
WRITE : 'File open error occured.'.
STOP.
ENDIF.
LOOP AT IT_OUTPUT INTO WA_OUTPUT.
TRANSFER WA_OUTPUT TO W_DSN.
CLEAR WA_OUTPUT.
ENDLOOP.
IF SY-SUBRC NE 0.
WRITE : 'File write error occured.'.
EXIT.
ENDIF.
CLOSE DATASET W_DSN.
ENDFORM. " TRANSFER_DATA_TO_FILE
&----
*& Form FTP_TRANSFER
&----
text
----
FORM FTP_TRANSFER.
PERFORM BUILD_FTP_FILE.
PERFORM TRANSFER_FTP_FILE.
*
ENDFORM. " FTP_TRANSFER
&----
*& Form BUILD_FTP_FILE
&----
text
----
FORM BUILD_FTP_FILE.
W_FTP_DSN = '/usr/sap/trans/mmpp/createcheck.txt'.
CONCATENATE 'open'
'www.info.com'
INTO WA_FTP-FIELD
SEPARATED BY SPACE.
APPEND WA_FTP TO IT_FTP.
CLEAR WA_FTP.
CONCATENATE 'user'
'myusername'
'mypassword'
INTO WA_FTP-FIELD
SEPARATED BY SPACE.
APPEND WA_FTP TO IT_FTP.
CLEAR WA_FTP.
CONCATENATE 'cd'
'/oracle01/oracle/product/iSuites/Apache/Apache/htdocs/etrans/user/upload/'
INTO WA_FTP-FIELD separated by space.
APPEND WA_FTP TO IT_FTP.
CLEAR WA_FTP.
MOVE 'put /usr/sap/trans/mmpp/createnew.txt' TO WA_FTP-FIELD.
APPEND WA_FTP TO IT_FTP.
CLEAR WA_FTP.
MOVE 'close' TO WA_FTP-FIELD.
APPEND WA_FTP TO IT_FTP.
CLEAR WA_FTP.
MOVE 'bye' TO WA_FTP-FIELD.
APPEND WA_FTP TO IT_FTP.
CLEAR WA_FTP.
OPEN DATASET W_FTP_DSN FOR OUTPUT IN TEXT MODE.
LOOP AT IT_FTP INTO WA_FTP.
TRANSFER WA_FTP-FIELD TO W_FTP_DSN.
CLEAR WA_FTP.
ENDLOOP.
CLOSE DATASET W_FTP_DSN.
ENDFORM. " BUILD_FTP_FILE
&----
*& Form TRANSFER_FTP_FILE
&----
text
----
FORM TRANSFER_FTP_FILE.
FREE TABL.
CONCATENATE 'ftp -v -n < 'W_FTP_DSN INTO W_PARCOM_LOC.
CALL 'SYSTEM' ID 'COMMAND' FIELD W_PARCOM_LOC
ID 'TAB' FIELD TABL-SYS.
IF W_ERROR_FLAG = '*'.
MESSAGE I036(ZIMM).
ELSEIF W_ERROR_FLAG = 'F' .
MESSAGE I139(ZIMM) WITH W_FNAME.
ELSE.
MESSAGE I038(ZIMM) WITH W_FNAME.
ENDIF.
ENDFORM. " TRANSFER_FTP_FILE
regards,
VRIT.
‎2007 May 08 6:21 AM
As i am new to ABAP this task is looking complex for me .
Help is very much appreciated.
regards,
VR IT.