Routing based on header record RECPOR in IDOC File

I am working a flat file (actually, its an IDOC file) that will enter the configuration scenario through a Seebruger SFTP adatper.  Since this is a flat file, and not XML, I need to convert this to XML prior to doing content based routing in the receiver/interface determination.
I am most concerned with the RECPOR field.
RCVPOR : Receiver port
internal data type : CHAR
Internal length : 000010 characters
Position in segment : 024, Offset : 0263. external length : 000010
The scneario is a simple passthrough.  What I envision doing is converting the IDOC Flat file to an XML structure, then doing content based routing on the one field I am interested in, as mentioned above.
Is there a way to do this without modifying the payload in teh sender/receiver channels, or am I going to be forced to doing content conversion with MessageTransformationBean?
Since all of my routing will be done on 10 characters, I see breaking the file up into 3 fields...characters 1-263, 263-273, 273-EOF does some one have a sample of how to separate this, and how to recombine the values in the receiver?

If I wanted to break the file up into 3 elements in a simple XML strcuture....
I know its possible to do this using fixed field lengths...is there a method to break that file up int a simple xml structure with, lets say, 3 elements....
Where field 1 contains from the start of the file (1) thorugh say character 31.  Filed 2 contains 31-41 then the third field to contain the rest of the file?  These 'flat files' could be any one of a dozen or so IDOC files that are being sent to me from an external EDI Translator.

Similar Messages

  • PMW/ACH Vendor Payments - Batch Header Record (5) not in file

    We're trying to get PMW/ACH vendor payments up and running, and thought we were about ready to send a test file to the bank, but I've discovered we have no batch header (record type 5) in the file?
    We're configured to use the PMW.  I have checked and rechecked our configuration, but must be missing something?  We have payment methods and banks configured.  Variants defined and bank/master data set up on a few vendors for testing. Everything else seems to be working fine. A small test via F110 selects these vendors into the file for payment, prints advices, and posts FI documents in SAP properly. I have record types 1, 6, 8, and 9 in the file...but no 5 (Batch Header).
    Any guidance would be greatly appreciated.
    Thanks.
    Lisa Tanner

    Record 5 is defined by the Format Supplement in FBZP, Payment method/country. Here you will find 3 supplements CTX, CCD and PPD.

  • UDF - Removing Header Record from File

    Hi Team,
    In my file(File Content Conversion) to ABAP server proxy scenario...
    The source File structure is like this...
    KUNNR|Matnr|Description----->(This is Hearder Record.Each File contains this header record.)
    1001|0077321|Special Materials
    1002|0077323|Raw Material
    File adapter will picks the file , In Message Mapping The first record is the Header Record from the above file structure.So I need to remove the Header Record.
    Can we handle  this requirement with any FCC parameter ;I think we can do it with the help of UDF in MessageMapping?
    Can anybody ghelp me the sample code for this.
    Thanks.
    Drumi

    Hi,
    You can use Document Offset in FCC to  specify the number of lines that are to be ignored at the beginning of the document.
    Regards,
    Priyanka

  • IDOC-File - records in Idoc to file based on some condition

    Hello experts,
    I have a idoc to file scenario. the incoming Idoc can have multiple records in it and i have to map these records to a csv file. Now the problem is not all records has to be mapped to the file. Based on the value of a perticular file (which is not root), i need to decide if the entire record has to be processed or not. Like the idoc structure is say:
    IDOC
       E1WPA01            0....9999
          E1WPA04         0...99
              KONDART     0..1
    Now for all valid E1WPA01 where the value of KONDART equals to some spacified value (known) , there has to be one record in the target csv file.
    How can this be done at the root level?
    One way of doing is we give empty values in the target file where the condition of KONDART is not fulfilled. Say if there are 10 records of E1WPA01 and only 4 satisfies the condition, we will ahve 10 records in the output file but only 4 records will have value and the rest 6 will be blank like (,,,,,,,). But I dont want this. I want only 4 records in the output file.
    I tried mapping like this:
    E1WPA01----
    >Advanced -
    > Root
    E1WPA04-KONDART---->UDF
    The problem i am facing here is if 4 records fulfill the condition, the first 4 are taken and the revelent 4.
    Please help.
    Regards,
    Yash

    Hi Chirag,
    I wrote the following code in UDF:
    for(i=0;i<a.length;i++)
    if(a{i}.equals("Specified Values"))
    result.addValue("a{i}");
    else
    result.addValue(ResuktList.SUPPRESS);
    And its working partially. I mean the queue of the UDF looks like
    1. AAAA                      SUPPRESS
    2. <Specified value>     <Specified value>     
    3. AAA                        SUPPRESS
    4. AAA                        SUPPRESS
    5. AAA                        SUPPRESS
    6. AAA                        SUPPRESS
    7. <Specified value>     <Specified value>
    8. AAA                        SUPPRESS
    9. AAA                        SUPPRESS
    and it creates 2 ROOT nodes. But the root nodes are created for line 2 and line 8 insteed of 7.
    What can be problem??
    Yash

  • IDOC Header Record

    Our scenario is  File(s) ---> XI -
    > IDOC
    We are receiving 3 Different Files, with Employee information from 3 different Countries and using XI , the records will be posted into R/3. Each record from the file will be treated as an IDoc.
    The File is going to contain the Header Record, followed by the Detail records.
    The header record will determine from whom this file was sent and we need to map the header info with the Control record.
    How can I achieve the above task of separating the Header Record and the other detail records in the Message Mapping.
    I would Greatly appreciate the Help.

    hi Karen,
    if you target XML fill contain
    one header and many details (which have to be transformed into many idocs) then you can do it in
    1:N mapping
    1 file N idocs
    just map the header so that it occures many times
    (as many as the details section)
    if I understand your issue correctly
    Regards,
    michal

  • How to create sqlplus output spool to a flat file  with a header record

    Hi all,
    I've requirement to spool data from a table to a flat file along with column headings in the first row.I'm getting data but I need header record in the first row also?
    Thanks,
    Mahender.

    Hi, Mahender,
    If you give this SQL*Plus command before you start SPOOLing
    SET   PAGESIZE  50000then you can get the usual SQL*Plus column headings, and they won't repeat unless you have more than 50,000 rows of output.
    When I can't do that, I use PROMPT
    {spool}
    SPOOL foo.txt
    PROMPT empno ename job mgr ...
    SELECT empno, ename, job, mgr ...
    PROMPT will trim leading whitespace (unless you enclose it in quotes), but it will leave spacing between the columns alone.
    You could also do a separate query, where you select some literals from dual:SPOOL foo.txt
    SELECT ' empno ename job mgr ...'
    FROM dual;
    SELECT empno, ename, job, mgr ...

  • How to create a partner and header record using CRM_ORDER_MAINTAIN?

    Hi any one knows how to create a partner and header record using the function module CRM_ORDER_MAINTAIN??
    I tried to  create a record, but i only managed to create a header record and the partner record is not reflected in the transaction.  Why is that so? is there any indicator that i need to include?
    Thanks..
    Jen

    Hi Jen!
    I use this FM and it works perfectly.
    Use this to create a partner:
      gs_partner-ref_handle    = '0000000001'.
      gs_partner-ref_kind      = 'A'.
      gs_partner-ref_partner_handle = '0001'.
      gs_partner-partner_fct   = '00000001'.
      gs_partner-partner_no    = NO_PARTNER. "number of the partner, bu_partner
      gs_partner-display_type  = 'BP'.
      gs_partner-no_type       = 'BP'.
      gs_partner-kind_of_entry = 'C'.
    *  ls_partner_l-ref_handle    = '1'.
      gs_partner-ref_guid      = '00000000000000000000000000000000'.
      APPEND gs_partner  TO gT_partner .
      ls_input_field-ref_kind  = 'A'.
      ls_input_field-logical_key   = '0001'.
      ls_input_field-objectname  = 'PARTNER'.
      ls_input_field-ref_handle  = '0000000001'.
      ls_input_field_names-fieldname = 'DISPLAY_TYPE'.
      INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
      ls_input_field_names-fieldname = 'KIND_OF_ENTRY'.
      INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
      ls_input_field_names-fieldname = 'NO_TYPE'.
      INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
      ls_input_field_names-fieldname = 'PARTNER_FCT'.
      INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
      ls_input_field_names-fieldname = 'PARTNER_NO'.
      INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
      INSERT ls_input_field  INTO TABLE  gt_input_fields.
      clear ls_input_field-field_names[].
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
      EXPORTING
    *    it_schedlin_i   = gt_schedlin_i_com
        it_partner      = gt_partner
    *    it_sales        = gt_sales
    *      it_orgman       = gt_orgman
    *      it_appointment  = gt_appointment
    *      it_ordprp_i     = gt_ordprp_i
    *   it_product_i    = gt_product_i
    *      it_activity_i   = gt_activity_i
    *      it_pridoc       = gt_pridoc_com
      CHANGING
        ct_orderadm_h   = gt_orderadm_h
    *   ct_orderadm_i   = gt_orderadm_i
        ct_input_fields = gt_input_fields.
    *      ct_doc_flow     = gt_doc_flow
    *      cv_log_handle   = gv_log_handle.
    Hope it helps u,
    Regards,
    Mon.

  • How to handle the control records in case of file to idoc scenario.

    Hi All,
    can you please clarify me how to handle the control records in case of file to idoc scenario.

    Hi,
    In File to Idoc scenario even though you selected apply control record values from payload and you are not getting those correct values which you have provided in the mapping.
    Also check the checkboxes Take sender from payload and Take receiver from payload along with the Apply control record values from payload checkbox
    Regards
    Seshagiri

  • What is the use of EIN_FEDERAL and EIN_STATE_LOCAL fields in Voucher header record (PeopleSoft AP) ?

    What is the use of EIN_FEDERAL and EIN_STATE_LOCAL fields in Voucher header record (PeopleSoft AP) ? And where can we check record field related information in PeopleBooks ?

    Hi User,
    The best place to search for questions like this one is OTN, Oracle Technology Network. If you have any question about CLOUD and partnering with Oracle we will be more than glad to help! Thanks.

  • Report to display all the status records of an Idoc

    Hi,
      I need to find out all the status records for an idoc and display them as a report. Is there any existing SAP Report that does that. I checked in table edids and all the status records of the idoc are not stored in the status text which is empty althogh there are 12 counters for the idoc.
    regards
    Aveek

    Hey Aveek;
       Try this, which will get the most recent one.  You would just need to change it to loop at the edids records to get at them all...
          TABLES: *edidc, *edids, *t100.
          DATA: wf_string type string.
          CLEAR *edids.
          SELECT SINGLE *
             INTO *edids
             FROM edids
             WHERE docnum = *edidc-docnum
               AND status = '51'.
          SELECT SINGLE text
             INTO *t100-text
             FROM t100
             WHERE sprsl = 'EN'
               AND arbgb = *edids-stamid
               AND msgnr = *edids-stamno.
             CLEAR wf_string.
          MOVE *edids-stapa1 TO wf_string.
          REPLACE '&' WITH wf_string INTO *t100-text.
          IF sy-subrc EQ 0.
            CLEAR wf_string.
            MOVE *edids-stapa2 TO wf_string.
            REPLACE '&' WITH wf_string INTO *t100-text.
            IF sy-subrc EQ 0.
              CLEAR wf_string.
              MOVE *edids-stapa3 TO wf_string.
              REPLACE '&' WITH wf_string INTO *t100-text.
              IF sy-subrc EQ 0.
                CLEAR wf_string.
                MOVE *edids-stapa4 TO wf_string.
                REPLACE '&' WITH wf_string INTO *t100-text.
              ENDIF.
            ENDIF.
          ENDIF.
          A little sloppy (OK, alot!), but it gets the job done...
    Cheers,
    John

  • Content Conversion issue for header record

    Hi,
    We have a very urgent question on an issue here with one of our XI objects. 
    This is an inbound interface from an external system into R/3 & BW.  The inbound file has a header record (with about 8 fields) and detail records (about 900 fields per detail record). Data going into R/3 & BW don't have header records and everything goes in as detail records. One field from the header of this source file should be passed to the target structure at the detail level. Also, we are NOT using BPM.
    Can someone help us how we could define the file content conversion parameters for File adapter.
    Thanks in advance ......
    Prashant

    I'm so sorry, I wasn't subscribed to this thread and I didn't realize there were responses.
    If you have a message type made up of a Header with 1 occurence and Detail with 1 to unbounded occurunces, you'd want to do the following in content conversion:
    Document Name - your message type
    Document Namespac - your message type namespace
    Recordset Structure - Header,1,Detail,*
    Recordset Structure - Ascending
    Then you'll need to set some of the parameters, depending on the layout of your incoming file. 
    As for the problem of having hundreds of fields, I'm less sure about that.
    Would it be possible to break your detail data type down into smaller data types.  Each with fewer fields.  You'd still have to maintain every field in content conversion, but at least they'd be in seperate parameters, instead of all 900 in one tiny box.
    Here's a very rough example of what I mean:
    If you have 900 fields, instead of making 1 data type of detail, you could make 9 data types, Detail1, Detail2, Detail3, Detail4, Detail5, Detail6, Detail7,Detail8, Detail 9, each with 100 fields in them (or more with even less fields).
    Setting things up the file content conversion would be more complex in this scenario, so it might be a toss up if it's worth it to break it up this way or not if it meant configuring quite a few more parameters.
    For example,
    You'd have to declare your recordset structure like Header,1,Detail1,,Detail2,,Detail3,* etc, and you'd have to make sure to set the .endSeparator to '0' for all of the first 8 details, so it would recognize that they were all on one line.
    I hope this helps a little bit.

  • Flat file export with a “Constant” header record???

    I have a mapping that export the records of a table in a Flat File.
    But I need to agreggate a constant in the first line of the export file (Header Record)
    For example ‘AAABBBCCCDDDEEEFFFGGG’
    How Can I put a “Constant” Header record?

    Marcelo,
    When you use flat file as a target you can set the header to be your field names. Now... it looks like this is not exactly what you are looking for.
    Alternative is to use a pre mapping procedure to create your file with the one line in it, and have the mapping produce additional records that are appended to the first line. Whether you create a new file or append to an existing file is a property on the target file, if I am not mistaken (it would be a configuration property otherwise).
    Thanks,
    Mark.

  • Header Record not repeated when detail records span to more than a page

    In RTF template,
    1. I have a for-each with code of
    <?for-each@section:G_HEADER?>
    2. Under 'for-each', I have the header record is defined in a 1 table row.
    The row property for this table is set to 'Repeat as header row at the top of each page'
    3. Under this I have another table with fields for LINES data with its own 'for-each' code <?for-each:G_LINES?>
    4. Followed by end for the above two 'for-each'
    However, when I generate the PDF output from Preview, when the lines data spans to more than one page, the header record is not repeating on the subsequent pages. Anyone has any ideas how to fix this
    My XML Publisher version is 10.1.3.4.1 Build 130. I have a sample data and the template, but not sure if I can upload here.

    user6098416 ,
    I am also facing the same Problem as yours.
    My Template layout is as follows:
    <?for-each:G_HEADER?>
    Header table
    <?for-each:G_DTL1?>
    detail table  -->  (<?for-each:G_DTL2?> Detail Fields <?end for-each?> )
    <?end for-each?>   --> End for each for G_DTL1
    <?end for-each?>   --> End for each for G_HEADERMy problem is Header Table is not repeating on each page when detail Table data goes beyound one page.
    I tried the following but its not working:
    <?template:header?>
    Header table
    <?end template?>
    <?for-each:G_HEADER?>
    <?call@inlines:header?>
    <?for-each:G_DTL1?>
    detail table  -->  (<?for-each:G_DTL2?> Detail Fields <?end for-each?> )
    <?end for-each?>   --> End for each for G_DTL1
    <?end for-each?>   --> End for each for G_HEADERI am not sure whats wrong here.
    Thanks
    Sandeep

  • How to send 100 records from an IDOC to File Scenario without using BPM?

    Hi All,
    I have a requirement that i need to send 100 records from sap to file by using the scenario IDOC to File. Can you suggest how can i achieve this?
    Regards,
    Ramvilas.

    Hi,
       Create a H type RFC destination.Tagert host and port give  Xi system host and port.Path give the
       /sap/xi/adapter_plain?namespace=<NameSpcae>&interface=<Interface> &service=<SenderBusinessSystem>&qos=EO or EOIO.
    Go to we21 find xmlhttp port.give the port name and assign RFC.Give the port in we20 your idoc and change to collective.
    In Xi export the IDOC and change the occurance to 0-unbounded and import it.
    Regards,
    Prakasu.M

  • Select Switch Executive Route based on Socket Index

    Hi,
    I have a sequence set up in TestStand which simultaneously tests up to 4 UUT's. In order to run a current measurments, I need to be able to switch each device through the DMM. I have the routes properly configured in Swith Executive, and everything runs fine when I switch manually using the Test Panel feature. What I need to do now though, is choose which device is routed to the DMM based on its test socket number. 
    So, for the "Measure Current" test step on "Test Socket 0", I go to the Properties>Switching window and just select "Connect_UUT0" route group. This works fine for a single test socket, but how can I dynamically switch route when I have more than one UUT?
    I'm aware of the "RunState.TestSockets.MyIndex" variable, but I can't seem to select a route based on this. ie: In "Routes to Connect" I typed "Str(Connect_UUT)+Str(RunState.TestSockets.MyIndex)" after I read a similar solution on this forum, but I just get an error.
    I'd really appresciate some help on this,
    Thanks,
    Kevin
    Solved!
    Go to Solution.

    Hey Kevin,
    You shouldn't need to do Str(Connect_UUT). You're likely getting the error because it's trying to interpret Connect_UUT as a variable instead of a string. Try this instead:
    "Connect_UUT"+Str(RunState.TestSocks.MyIndex)
    I think that will work, but let us know if you run into any more trouble!
    Daniel E.
    TestStand Product Support Engineer
    National Instruments

Maybe you are looking for