Need  ABAP coding in  Proxy TO File scenario

Hi friends,
  i need  to do the  Proxy to file scenario.. for this.. i want to retrive the data from R/3 system and  load the data into the class which we defined in SPROXY  (Outbound  class) ..
so, can any one give me the exact coding... for this.. how can we move the data from our executable program  to  Outbound Class  structure....
helpful answers will be appriciated..
Thanks
Babu

<i>i want to retrive the data from R/3 system and load the data into the class which we defined in SPROXY (Outbound class) ..</i>
-->
data: cproxy type ref to ZCO_MI_MKPROXY2RFC_OUT,
      itab_out type  ZMT_MKPROXY2RFC_OUT,
      itab_in type   ZMT_MKPROXY2RFC_RES.
TYPES: BEGIN OF values,
         carrid TYPE spfli-carrid,
         connid TYPE spfli-connid,
       END OF values.
DATA: progname like sy-repid,
      dynnum   like sy-dynnr,
      dynpro_values TYPE TABLE OF dynpread,
      field_value LIKE LINE OF dynpro_values,
      values_tab type table of values.
  progname = sy-repid.
  dynnum   = sy-dynnr.
  CLEAR: field_value, dynpro_values.
start-of-selection.
parameter: p_carrid like sflight-carrid  obligatory value check,
            p_connid like sflight-connid.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
       EXPORTING
            tabname     = 'DEMOF4HELP'
            fieldname   = 'carrid'
            dynpprog    = progname
            dynpnr      = dynnum
            dynprofield = 'p_carrid'.
CALL FUNCTION 'DYNP_VALUES_READ'
  EXPORTING
    DYNAME                         = progname
    DYNUMB                         = dynnum
  TABLES
    DYNPFIELDS                     = dynpro_values
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 dynpro_values index 1 into field_value.
SELECT  carrid connid
    FROM  spfli
    INTO  CORRESPONDING FIELDS OF TABLE values_tab
    WHERE carrid = field_value-fieldvalue.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
  EXPORTING
    RETFIELD               = 'connid'
   DYNPPROG               = progname
   DYNPNR                 = dynnum
   DYNPROFIELD            = 'CONNECTION'
  TABLES
    VALUE_TAB              = values_tab
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
      TRY.
          CREATE OBJECT cproxy.
          itab_out-MT_MKPROXY2RFC_OUT-CARRID = p_carrid.
          itab_out-MT_MKPROXY2RFC_OUT-CONNID = p_connid.
          progname = sy-repid.
          dynnum = sy-dynnr.
          CALL METHOD cproxy->EXECUTE_SYNCHRONOUS
            EXPORTING
              OUTPUT = itab_out
            IMPORTING
              INPUT  = itab_in
        CATCH CX_AI_SYSTEM_FAULT .
        write:   itab_in-MT_MKPROXY2RFC_RES-CURRENCY,itab_in-MT_MKPROXY2RFC_RES-FLDATE,
                  itab_in-MT_MKPROXY2RFC_RES-PLANETTYPE,itab_in-MT_MKPROXY2RFC_RES-PRICE,
above code reads carrid and connid from screen and the same are passed to proxy..
hope you can relate it to your requirement....
                  itab_in-MT_MKPROXY2RFC_RES-SFATSMAX,itab_in-MT_MKPROXY2RFC_RES-SEATSOCC,
                  itab_in-MT_MKPROXY2RFC_RES-STATUS.

Similar Messages

  • ABAP client proxy to File scenario

    Hi,
    I am doing ABAP client proxy to File scenario.
    I have followed Ravikumar allampallam blog i.e https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1387. [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    My abap proxy has successfully created 4 objects:
    1)ABAP Class ( ZCO_ MIOA_ABAP_PROXY).
    2. Structure for the message type in ABAP Data Dictionary (ZMT_PROXY).
    3. Structure for the data type in ABAP Data Dictionary (ZDT_PROXY_SRC).
    4) Table type (ZSTRING_TAB).
    can u tell me how can i fetch data from database table into structure?

    Hi,
    see first create the data type,msg type, msg interface and go to R3 instance of Xi and use SPROXY transaction , locate your SWCV,namespace, intreface ( outbound) and create the proxy , later give the name starts with z, later in ABAP program create the internal table of type of the Structure for the message type in ABAP Data Dictionary (ZBLOGEMP_PROFILE_MSG )
    so follow the code and explained about each ob, structure of Msg ..
    Regards
    Chilla

  • Proxy To file scenario : need the output in hierarchial structure

    Hi all,
    I am doing a proxy to file scenario. Now I am getting the output as :
    <documents>
    <document>
    <header>
    <delivery_number></delivery_number>
    <tax_number/>
    u2026
    </header>
    <data>
    u2026
    </data>
    </document>
    <document>
    <header>
      u2026
    </header>
    <data>
       u2026
    </data>
    </document>
    u2026
    </documents>
    But I would like to change the output to below structure.
    <documents>
               <document>
         <header>
                                 <delivery_number></delivery_number>
                                 <tax_number/>
                                  u2026
                         </header>
         <data>
                                     u2026
                          </data>
               </document>
               <document>
         <header>
                                 u2026
                          </header>
         <data>
                                u2026
                         </data>
                 </document>
    u2026
    </documents>
    Can anyone suggest me how can I get this?
    Thanks,
    Arivarasu S
    Edited by: Arivarasu S on Jan 31, 2011 2:54 PM
    Edited by: Arivarasu S on Jan 31, 2011 3:00 PM

    <documents>
          <document>
                <header>
                           <delivery_number></delivery_number>
                            <tax_number/>
                                      u2026
                 </header>
                 <data>
                            u2026
                  </data>
           </document>
    </documents>
    I need the output as mentioned above.. pls let me know how can i achieve this..
    Thanks,
    Arivarasu S
    Edited by: Arivarasu S on Jan 31, 2011 6:59 PM

  • Do we need a Inbound Inteface  in a Proxy to File scenario

    Hi,
    In Proxy To File Scenario, please let me know whether we have to create inbound Message Interface or not ?
    1) If it not required to create inbound Message Interface in Proxy To File Scenario, then what is the procedure to pick the Inbound Interface  in Interface Determination?
    Thanks in advance
    Abhishek

    Have a look at this
    Proxy to File
    Dimitris

  • Proxy to File scenario - IDOC as an flat file

    Hi,
    I am working on ABAP Sender Proxy to File scenario. The target structure in the message mapping is SHPMNT05 IDOC and the output of the file needs to be in the text format and then the file will be send to an EDI subsystem.
    Currently, EDI subsystem gets the IDOC from ERP system as a flat file and expects the similar kind of file from XI system
    The requirement is to have all the fields of the IDOC in the target file. If data does not exist for a particular field, then there should be a space for that field in the text file.
    I would like to know if there is any other standard way of executing this scenario apart from using File Content conversion. In case if we have to use FCC, how difficult it would to be implementing the scenario. Please note that the output file needs  all the fields of IDOC in it.
    Regards,
    Sakthi
    Edited by: Sakthi on Sep 26, 2008 11:24 AM

    Hello Sakthi,
             By coding in proxy populate the idoc structure if it is difficult to handle thru Content conversion parameters then create an intermediate structure and populate that structure by concatenating the fields from idoc segments. If the fields are not having the values then add blank spaces as per length of the field.
    You can configure the file channel and content converison parameters for the intermediate structure.
    Hope it will helps to you.
    Cheers
    Veera

  • Proxy to file scenario issue

    Hi,
    I am trying to configure a Proxy to file scenario.
    My sender service is ERP system and the my receiver is PI file system.
    These are the steps I followed:
    1. Created a sender business system for Web AS abap (my ERP system)
    2. Created a receiver business system for third party (my PI system)
    3. I created all the interface objects(datatype, message type, message interface etc) in Integration repository.
    4. In the ERP system , I configured http connection of type h to PI system and also configured lcrsaprfc, sapsldapi connections of type t. I followed this blog: How do you activate ABAP Proxies?
    5. I also configured the ERP system as local integration engine, by setting the role to application system in sxmb_adm (followed the above blog).
    5. Now I generated proxy in sproxy transaction for the outbound interface.
    6. Then I created the communication channel, receiver agreement, interface determination and receiver determination in Integration directory.
    7. I created a abap program to call the execute_asynchronous method.
    Now the issue is, when I execute my report, nothing happens. I can see the success xml message in sxmb_moni in ERP system. No message is seen on the PI's sxmb_moni. The file is not written either to ERP or PI systems.
    Since I am new to PI, I am not sure where to begin with.
    If anybody can help that would be great.
    Thanks
    MLS

    Hi
    Check the following
    1. RFC connection between R/3 and PI
    2. You said Business system of type third party (PI) is receiving it. Try Business system standalone Java. If PI system is already defined in Landscape as Integration server. It will not show any message output.
    3. message is shown in sxmb_moni in your ERP that measn proxy is able to receive all objects and passed it from there.
    4. Check in SMQ2 outbound queue of ERP as well as inbound queue for PI if message exist.
    5. While configuring in ID you dont need a sender agreement. Did you created one.
    Thanks
    Gaurav

  • Error in Proxy to File scenario

    Hello All,
    I m doing Client Proxy,  ABAP proxy to file scenario.
    I hv done all the configurations in IR & ID.
    I hv also created proxy in sender R3 system.
    But messages are not going successfully from R3.
    when i checkin SXMB_MONI of R3 i get following error
    <SAP:Stack>Error when receiving by HTTP (error code: 110, error text: )</SAP:Stack>
    Message is in SYSFAIL status in SMQ2.
    Any clues how it can be solved??
    Thanks in adv.
    Mahi

    Hi Maheshwari,
    Please try as mentioned below
    Option 1: Go to SXMB_ADM->Manage Queues and Deregister all the Queues.Use transaction SMQR or SMQ2 to reset the status of queues
    For this to initiate processing of messages stuck in the queue, make sure to set following IS configuration parameter
    MONITOR QRFC_RESTART_ALLOWED to value 1
    Option 2: Check the user associated with the RFC destination AI_RUNTIME_JCOSERVER in sm59 transaction. It is generally SAPJSF. Might be posisble the user password is expired or locked. Log on to j2ee admin tool on the server side and update the password and then see if it works.
    Thanks
    Amit
    Reward points if answer is helpful

  • Proxy to file scenario

    Hi SDN,
    I have  a query regarding a Proxy to File scenario. Whenever the ABAP proxy populates the structure an d sends the data accross to XI  to genarate a file structure, then how does it confirms that the structure is sent to SAP.XI or to somewhere else? How is the confirmation done? and where is it done at Sender side or at the XI side?
    Thanks,
    Aniruddha

    Hi,
    >>>How is the confirmation done?
    if you do not set ack request it does not do any confirmation - you only see the successful flag in ECC and in PI
    nothing more
    Regards,
    Michal Krawczyk

  • Outbound Proxy - XI - File scenario. Outbnd proxy not callin XI.

    Hi All,
    I have a requirement where I have to develop a Outbound Asynch Proxy-> XI -> File scenario.
    For this I have crated an Outbound Asynch proxy and called this proxy from a report in ABAP.
    When I execute the report, i am unable to see the message in XI Moni.
    But when I try to emulate the same scenario by passing a message from the RWB Test Page, the message is flowing to the file successfully.
    It seems that the problem is just that the ABAP report is unable to call the XI by executing the outbound proxy method.
    The code for the report is as below:
    *& Report  Z_ASYNCH_PROXY
    REPORT  Z_ASYNCH_PROXY.
    data prxy type ref to ZFUJCO_SI_TEL_NUM_RFC_RESP_ASY.
    data out type ZFUJMT_TEL_NUM.
    out-MT_TEL_NUM-TEL_NUM = 'test_proxy'.
    create object prxy .
    TRY.
    CALL METHOD prxy->si_tel_num_asych_in
      EXPORTING
        output = out
    commit work.
    CATCH cx_ai_system_fault .
       DATA fault TYPE REF TO cx_ai_system_fault .
        CREATE OBJECT fault.
        WRITE :/ fault->errortext.
    ENDTRY.
    Please tel me how to find out that where the message is getting stuck and resove this.
    regards,
    Piyush

    Hi All,
    Thanks a lot for ur inputs.
    i was able to resolve it.
    The pointers are:
    - The message was gettting stuck in the queues XBTS0009 of the Bus system. I chekced it in SXMB_MONI of bus syst.
    - i activated the queues usung SXMB_ADM -> manage queues
    - The HTTP destinatin was not maintained for the connectino to the PI Url. In fact the url was hardcoded in the sicf -> xi-> engine
    I maintained this using
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3414900)ID1803326050DB10288658103888810737End?blog=/pub/wlg/3022
    Thanks for all your help.
    regards,
    Piyush

  • Proxy to File Scenario Steps

    Hello everybody-
    I am trying a proxy to File scenario, Its from SRM-XI-File , i have followed the blog
    Learning XI
    but the question i have is, if iam sending a invoice from SRM to XI , what are the configuration steps that i need to do in SRM and in XI, i mean how do i configure proxy in SRM?(in that matter any source system), Can someone tell me the configuration steps that need to be done in SRM and XI to use proxies.

    Venkat
    Instead of using proxies for sending invoice from SRM use IDOC's. There are idocs aviable to do this activity. But if u are going to recive a response then u might think of proixes as idocs supports only asyn interface. for large data voumens make use of proxies.
    Go through SRm master guide that gives you details of Standard Interface available.
    service.sap.com/installation
    and then goto SRM - Master Guide
    also
    SRM, like many other mySAP Business Suite applications, provides standard XI Content. You can download that content from here:
    http://service.sap.com/swdc then
    Support Packages and Patches->SAP Application Components->SAP SRM (WITH SAP EBP)
    Then you go to the specific content version, depending on what SRM release you're on. also u can check with:
    http://service.sap.com/~sapidb/011000358700002897402004E/ServiceProcurementNEW.pdf
    http://service.sap.com/~sapidb/011000358700002897382004E/Plan-DrivenwithSInew.pdf
    http://service.sap.com/~sapidb/011000358700002897342004E/CCMConfig10_01_05.pdf
    http://service.sap.com/~sapidb/011000358700003992672005E/Config_Guide_CCM200_640doc.pdf
    NOTE: There are some preconfigured mappings available for SRM in www.service.sap.com. Check out this thread
    Is there pre-configured message mapping for SRM Content?

  • Proxy to file scenario ( pls gve me some inputs )

    I am Doing proxy to file scenario. i have some quries i want some suggestions regarding this scenario.
    Source  is proxy and Target  is File . i want to generate 6 files with same structure and different different filenames . I guess have to put condition in interface determination? is it correct? if it is correct what condition i have to put plz give me suggestions .
    filenames also generate different different names how it could be done in dynamic configuration? plz give me some inputs regarding this.
    Thanks
    Regards
    Tahir

    Hi,
    >>i want to generate 6 files with same structure and different different filenames
    How the filename is decided? If it is decided in runtime then you can go for single receiver channel and variable substitution.
    You need to make file name in the message mapping itself and assign it to a field of the target (or in any of the available message headers)
    If the filename is always constant (say then have names A, B, C etc with timestamp) . Then there should be a field in source structure which decide what file to be created right? here you can use receiver/interface determination with condition
    Regards
    Suraj

  • Error on PROXY to FILE scenario

    Hi,
    I'm working on a Proxy to FIle Scenario. 1 Proxy is triggered and 7 files should be generated at the target side.
    Now when the proxy is triggered all the 7 files doesn't get generated. Instead randomly some 3-4 files are getting generated.
    Could not see the rest of the entries in MONI also.
    Can someone tell how to monitor this and where exactly to check for the error, as message doesn't reach the MONI and we don't have a sender channel beacuse its Proxy.
    Thanks,
    Vikas

    Vikas,
    Can someone tell how to monitor this and where exactly to check for the error, as message doesn't reach the MONI and we don't have a sender channel beacuse its Proxy.
    > how 7 files will generate ?
    From Proxy level @ ECC it don't seems logical/possible as whole data will be passed as a whole to proxy interface and on some condition basis only you would be creating 7...files . so definitely at SXMB_MONI of XI you can see this .
    Try to increase trace_level parameter to 3 (only in development box , as it will consume the server very fast) for better monitoring .
    Since the no. of files will be created by file adapter only so those many no. of receiver file adapter calls you can see at RWB.
    Regards,

  • Proxy to file scenario - strange error

    Hi,
    we r finding a strange error occurring in our prd system. we have many scenarios of proxy to file and they all are running fine. the problem which is arising from the last few days is that - for some outbound interfaces at random, the message is generated in ECC, sent to XI and its file generated in local system of XI - this is fine - but what is happening as strange is the message is again getting processed in SMQ2 queue of ECC - this is the duplicate msg of the original msg - we can say this is duplicate msg becoz the msg id of the original msg in ECC, is available in XI with the same msg id and this erroring msg in SMQ2 is having the same msg id again - suggesting that somehow ECC is trying to process the same msg again.
    has anyone seen this type of error before. pls suggest how to rectify this error.

    hi,
    no upgrade happened recently.
    in ECC in SMQ2 queue the msg is erroring with error XI server CLIENT_RECEIVE_FAILED. INTERNAL Queue stopped. In SXMB_MONI in ECC the msg is erroring with :
    <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="INTERNAL">CLIENT_RECEIVE_FAILED</SAP:Code>
      <SAP:P1>402</SAP:P1>
      <SAP:P2>ICM_HTTP_TIMEOUT</SAP:P2>
    Error while receiving by HTTP (error code: 402, error text: ICM_HTTP_TIMEOUT)
    the scenario is async outbound proxy to file scenario. it is happening randomly for any interface and only a few times eg 1 msg out of 300 msg in a day is having this duplicate msg error.
    Please suggest.

  • Proxy-to-File scenario (Turkish Characters Encoding)

    Hi All,
    I have a Proxy to File scenario. (No Message Mapping...As the data is processed and sent as it is)
    The input data to PI contains Turkish characters, and the File getting generated at FTP location is converting some of those characters into special characters while I am using the encoding as "cp1252" in the Processing tab under "File Encoding" option of the Receiver File channel.
    e.g. :
    1)
    i/p   - MİA L poşet
    o/p - M?A L po?et
    2)
    i/p   -  İstanbul-Ankara gidiş dönüş uçak bileti
    o/p  - ?stanbul-Ankara gidi? dönü? uçak bileti
    As in the above examples, at the o/p side it is converting some charactres into "?"
    Could you please suggest the correct encoding used/steps to be followed in this case.
    Thanking you in advance.
    Thanks and regards,
    Neetish

    Hi Amit,
    I tried with cp1524.
    Now it is giving me
    1)
    i/p - MİA L poşet
    o/p - MÝA L poþet
    2)
    i/p - İstanbul-Ankara gidiş dönüş uçak bileti
    o/p - Ýstanbul-Ankara gidiþ dönüþ uçak bileti
    The "?" is now replaced with "Ý"
    Please suggest.
    Thanks.
    - Neetish

  • Proxy-to-File scenario. Acknologements.

    Hello Experts,
    We have a Proxy-to-File scenario, is it possible to receive on SAP-backend side acknolegement that the file was succesfully delivered to target FTP server.
    What are the options for this requirement? The only solution I can see right now is a BPM, where there is a transport acknowlegement selected on Send step. But are there are any other?
    Best Regards

    >
    Artsiom Anichenka wrote:
    > Hello Shabarish,
    >
    > Thanks a lot for your response!
    >
    > Maybe you know how this standart acknolegemnt mechanism works? What makes Adapter to send acknowlegemnt back to BPM? Maybe BPM sets some flag on message header?
    >
    > I am thinking about somehow to simulate this without the BPM.
    I am not sure about the underlying activity. But the step steps forces a request for acknowledgment in this case. I will wait to see if anybody can explain this. Will be a good info to know.
    Anyway,
    In case you got for a customized way, you may lose out on performance, hence since there is a standard functionality available, do opt for the same.

Maybe you are looking for

  • Itunes not responding when ipod is connected.

    first i should say that my ipod has been acting slow the past couple days. if i'm scrolling through songs it will frequently freeze for a few seconds before moving on to the next song that i scrolled to. plugging my ipod into my computer last night i

  • More effecient way of using Decode and CASE

    Is it possible to use both case and decode together? I feel I have too many decode and I am not sure how to write this in a more efficient way. I would really appreciate any help. Thank you so much in advance!!! SELECT  Person_ID,Work_ID,     CASE WH

  • Best thread method for a chat server

    What would be the best way to thread a chat server in Java? I understand threads, but I'm new to java. I'm just looking for links to the appropriate classes not code. I already have the send/receive methods planed, but I'm interested in the best ways

  • OBIEE 11g On Windows 7 home-  62-Bit

    Hi, I'm planning to install 11G on Windows 7 home - 62 Bit. Is RCU available for 62 - Bit. Please help me in installing with steps & Pre-requisities. Thanks for the help in advance.

  • Forms 9i - Image Palette

    The Image Palette functionality was removed from Forms9i. I was wondering if there are any plans to add this back in later.