Application Development 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: 

outbound iunterface

Former Member
0 Kudos
277

hi experts,

actually i am working on outbound iunterface.

in the target structure it is given as ,

1.header,

2, line items,

3, adress.

using my select statements i have retrived the data and in the target structure the data should be displayed as

1.header,

2, line items,

3, adress.

plz suggest me how to do.

regards,

siri.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
243

Hi,

If thats use file transfer technique...If your file is in the presentation server use gui_upload else use Open Dataset and Transfer Statement.

Reward if helfpul.

Regards

15 REPLIES 15

Former Member
0 Kudos
243

Hi Sireesha,

you need to follow following steps.

1. open the file to be created on application server.

OPEN DATASET app_path FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

2. get header data

PERFORM get_data_header.

3.transfer data to application server file.

TRANSFER v_header TO app_path.

4. get segment data

PERFORM get_data_segment.

5.transfer data to application server file.

TRANSFER v_segment TO app_path.

6. get address record.

PERFORM get_data_add.

7.transfer data to application server file.

TRANSFER v_add TO app_path.

8.CLOSE DATASET app_path.

Regards,

Sumit

and if you are trying to download data to your presentation server

1.move all the data in one internal table.

2. then call this FM

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = v_presentation_path

filetype = 'ASC'

TABLES

data_tab = i_presentation_data

EXCEPTIONS

file_write_error = 1

no_batch = 2

gui_refuse_filetransfer = 3

invalid_type = 4

no_authority = 5

unknown_error = 6

header_not_allowed = 7

separator_not_allowed = 8

filesize_not_allowed = 9

header_too_long = 10

dp_error_create = 11

dp_error_send = 12

dp_error_write = 13

unknown_dp_error = 14

access_denied = 15

dp_out_of_memory = 16

disk_full = 17

dp_timeout = 18

file_not_found = 19

dataprovider_exception = 20

control_flush_error = 21

OTHERS = 22.

Message was edited by: sumit kumar

0 Kudos
243

THANKX SUMIT,

CAN U HELP WITH A SAMPLE CODE IF U HAVE .

REGARDS,

SIRI.

Former Member
0 Kudos
243

Hi,

R u working on a EDI application ?

For an interface application you can use an IDOC, for which u`ll create segments and segment definition.

Reward if helpful.

Rgds

0 Kudos
243

no my requirement is not IDO,ALE,OR BAPI.

REGARDS,

SIRI.

Former Member
0 Kudos
244

Hi,

If thats use file transfer technique...If your file is in the presentation server use gui_upload else use Open Dataset and Transfer Statement.

Reward if helfpul.

Regards

0 Kudos
243

hi zapper can u plz give if u have any sample code for this.

regards,

siri.

0 Kudos
243

THANKS ZAPPER,

BUT MY REQUIREMENT IS TO TRANSFER DATA LIKE THIS

1. HEADER DATA,

2. LINE ITEMS DATA,

3.ADRESS DATA.

PLEASE CAN U ADD THAT CODE HOW TO DO.

REGARDS,

SIRI.

0 Kudos
243

Sireesha,

U need to populate the data from header data, lines data and address data into output internal table first. Next you need to use the output table to download / transfer the same.

---logic ---

data : begin of ioutput occurs 0,

line(80) type c,

end of ioutput.

loop at iheader.

concatenate iheader-f1 iheader-f2 into ioutput-line.

endloop.

similarlly do it for iline and iaddress.

later

open dsn.

loop at ioutput.

transfer ioutput to dsn.

endloop.

close dsn.

Message was edited by: Anurag Bankley

0 Kudos
243

THANKS ANURAG I populateD the data from header data, lines data and address data into output internal .

AFTER THIS I AM NOT ABLE TO GET THE LOGIC .

REGARDS,

SIRI.

0 Kudos
243

If you wish to transfer the file on application server than you can do the below.

OPEN DATASET dsn FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

Loop at ioutput.

transfer ioutput-line to dsn.

endloop.

close dataset dsn.

Message was edited by: Anurag Bankley

Former Member
0 Kudos
243

Hi,

Pls find the belowsaid sample code :

This should solve ur problem, reward points if so.


***********************internal table declaration *******


DATA:IT_RECORD LIKE TABLE OF DATA_RECORD WITH HEADER LINE,
                            "INTERNAL TABLE FOR STRUCTURE
     IT_BDCTAB LIKE TABLE OF BDCDATA WITH HEADER LINE,
                            "INTERNAL TABLE FOR BDC STRUCTURE
     IT_MSGCOLL LIKE TABLE OF BDCMSGCOLL WITH HEADER LINE.
                             "INTERNAL TABLE FOR MESSAGE COLLECTION


**********************file details*******



DATA OP_DSN(50) TYPE c VALUE 'E:USRSAPPRFCLOGXXXXX.TXT'.
"file name


*********************using gui upload*********

CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    FILENAME                     = 'C:XXXXX.TXT'
"to get data in internal table
    FILETYPE                     = 'ASC'
    HAS_FIELD_SEPARATOR           = '#'
  TABLES
    DATA_TAB                     = IT_RECORD.

******open file and transfer to application *server*******


OPEN DATASET OP_DSN FOR OUTPUT IN TEXT MODE." ENCODING DEFAULT.
 "opening file
LOOP AT IT_RECORD INTO DATA_RECORD.
"transfer from internal  table into structure
  TRANSFER DATA_RECORD TO OP_DSN  LENGTH 50000.
*  CLEAR IT_VENDOR.
ENDLOOP.
IF SY-SUBRC <> '0'.
  WRITE /'NOT TRANSFERRED'.
   "if not transferred
ELSE.
   WRITE / 'transferred'.
   "if transferred
ENDIF.

Regards

0 Kudos
243

THANKX ZAPPER,

BUT MY REQUIREMENT IS TO TRANSFER DATA AS FOLLOWS,

1, HEADER DATA,

2, LINE ITEMS DATA,

3,ADRESS DATA.

SO PLZ CAN U INCLUDE THAT CODE HOW TO TRANSFER.

REGARDS,

SIRI.

0 Kudos
243

THANKS ZAPPER,

BUT MY REQUIREMENT IS TO TRANSFER DATA LIKE THIS

1. HEADER DATA,

2. LINE ITEMS DATA,

3.ADRESS DATA.

PLEASE CAN U ADD THAT CODE HOW TO DO.

REGARDS,

SIRI.

0 Kudos
243

THANKS ZAPPER,

BUT MY REQUIREMENT IS TO TRANSFER DATA LIKE THIS

1. HEADER DATA,

2. LINE ITEMS DATA,

3.ADRESS DATA.

PLEASE CAN U ADD THAT CODE HOW TO DO.

REGARDS,

SIRI.

0 Kudos
243

THANKS ZAPPER,

BUT MY REQUIREMENT IS TO TRANSFER DATA LIKE THIS

1. HEADER DATA,

2. LINE ITEMS DATA,

3.ADRESS DATA.

PLEASE CAN U ADD THAT CODE HOW TO DO.

REGARDS,

SIRI.