Customized filename for output

Hi,
Is there someway to set the filename of an outgoing file adapter based on the contents of the file? We're processing invoices and would like to include the invoicenumber in the file containing the invoice ( each file can only contain exactly one invoice ).
Thanks in advance
Thomas

I use the following code in the xsl to create a custom filename:
<xsl:variable name="HR_ID"
select='/imp1:verstuurPlaatsingRequest/imp1:PlaatsingCompleet/ns1:StaffingAction/ns1:ReferenceInformation/ns1:HumanResourceId[@idOwner="StaffingCompany"]/ns1:IdValue[@name="id"]'/>
<xsl:variable name="FILENAME"
select="concat('albronuit_', kim:getCurrentDateTime('yyyyMMddHHmmssSSS'),'_', $HR_ID, '.xml')"/>
<xsl:variable name="SET_FILENAME_OUT"
select="ehdr:setOutboundHeader('/fhdr:OutboundFtpHeaderType/fhdr :fileName', $FILENAME, 'fhdr=http://xmlns.oracle.com/pcbpel/adapter/ftp/;')"/>
The first step takes the id from my input xml, the second creates the filename and the third passes this filename to the outboundheader.
Anne

Similar Messages

  • Custom Filename for Export Data from a Query

    Hi,
    Would like to define a custom filename for the file to be download as a csv from the web query, Is it possible?
    Regards
    Chocks

    This is not possible, it will be system generated.

  • OPEN DATASET FILENAME FOR OUTPUT.

    HI,
    While doing unicode enable inECC6.0 FOLLOWING ERROR IS COMING.hOW IT WILL BE RESOLVED.
    oPEN DATASET physname FOR OUTPUT.

    Hello,
    For opendataset u need to add the below coding.
    open dataset 'filename' for output in text mode encoding default. ( Based on ur filetype)
                                                            binary mode encoding default
    if it not a unicode system then non unicoding must be added.
    N.B
    In the Transfer stmt the data types apart from CNDT will result dump.
    So please ensure that all are of CNDT types.
    With Regards,
    Sumodh.P

  • Custom Filename for PDF Report

    Hi,
    I have a requirement to download pdf for a report. I provided the download action as a column link on the report. Clicking the link I direct to the URL for the custom report I created (f?p=&APP_ID.:0:&SESSION.:PRINT_REPORT= MyReport). Pdf gets downloaded with the name MyReport.pdf. But I need to provide a custom name for the downloaded pdf, it should be based on the Id value of the report column something like this Emp123.pdf where 123 is the employee Id (selected row's employee id value in my report).
    I searched in the forums and came across this thread APEX 3 PDF Report Export Custom Filename? but here its mentioned that
    " In this case there's no separate attribute for the file name. And we don't do substitutions on the report query name, so setting the name dynamically as you described in your sample, won't be possible. "
    Since the thread is a old one so posting a new one. Any pointers is highly appreciated.
    Thanks,
    Rakesh

    1. Call the report with utl_http.
    2. Store the output as a BLOB. Either local variable or store it in a table.
    3. Print the blob.
    Here is how you can print the blob and read the package spec for utl_http.
    Re: display a blob on webpage using mod-plsql

  • Setting up FileName for Output file in SendPort

    Hi - I have a requirement setting up FileName in output file. For instance say, whatever I receive in the 'FathersName' field that Output File should be with that File Name.
    For e.g. if data received in FathersName field is JOHN, output file name should be JOHN.xml
    I am using File Adapters on Receive and send side.
    Can this be achieved just by Messaging Scenario or do I need to implement this using Orchestration ?
    If so, please advise on how to do this ?
    e.
    MBH

    To achieve this, you will have to set your filename value on one of the Context Properties available as a File Adapter macro. For example FILE.ReceivedFileName is mapped to the %SourceFileName% macro.
    You have several options to do this:
    Set FILE.ReceivedFileName in an Orchestration.  It does not have to be Promoted.
    Write the Property ReceivedFileName in namespace
    http://schemas.microsoft.com/BizTalk/2003/file-properties in a Custom Pipeline Component.
    If FathersName can be used in the file name unmodified, you set FathersName as a Promoted Property on the schema and Promote directly to FILE.ReceivedFileName.
    For 1 & 2, you will have to extract FathersName somehow, such as a distinguished field.
    A Custom Pipeline Component or direct Promotion are the only way to achieve this in Messaging only.

  • Custom Filename for ESB FileAdapter Write

    Hi,
    I have a ESB service that monitors and deqeues from the oracle.apps.po.event.xmlpo business event via the Oracle Applications adapter. This works fine as the WF_EVENT_T schema is routed via an XSL to a custom XML which is used later.
    However, I want the file to use a custom filename with the file adapter. In principle I know how to do this using the ehdr:setOutboundHeader functionality and have got this to work when setting a static filename.
    However, I want to be able to create the filename based on the Purchase Order Number coming from the WF_EVENT_T schema. It seems that the ehdr:setOutboundHeader function has to be set before any of the XML Template matches, which means at this point the Purchase Order number is not available. Below is the main parts of the XSL.
    <xsl:variable name="CustomFilename" select="'/ns2:PONo"/>
    <xsl:variable name="AssignFilename"
    select="ehdr:setOutboundHeader('/ns1:OutboundFileHeaderType/ns1:fileName',$CustomFilename,'ns1=http://xmlns.oracle.com/pcbpel/adapter/file/Capture_PO_Event_Data/;')"/>
    <xsl:template match="/">
    <ns2:HCNPOWFEVENT>
    <xsl:for-each select="/imp1:WF_EVENT_T/PARAMETER_LIST/PARAMETER_LIST_ITEM">
    <xsl:if test='NAME = "DOCUMENT_NO"'>
    <ns2:PONo>
    <xsl:value-of select="VALUE"/>
    </ns2:PONo>
    </xsl:if>
    </xsl:for-each>
    <xsl:for-each select="/imp1:WF_EVENT_T/PARAMETER_LIST/PARAMETER_LIST_ITEM">
    <xsl:if test='NAME = "ECX_TRANSACTION_TYPE"'>
    <ns2:POType>
    <xsl:value-of select="VALUE"/>
    </ns2:POType>
    </xsl:if>
    </xsl:for-each>
    <xsl:for-each select="/imp1:WF_EVENT_T/PARAMETER_LIST/PARAMETER_LIST_ITEM">
    <xsl:if test='NAME = "ECX_TRANSACTION_SUBTYPE"'>
    <ns2:POSubType>
    <xsl:value-of select="VALUE"/>
    </ns2:POSubType>
    </xsl:if>
    </xsl:for-each>
    <xsl:for-each select="/imp1:WF_EVENT_T/PARAMETER_LIST/PARAMETER_LIST_ITEM">
    <xsl:if test='NAME = "ECX_PARAMETER5"'>
    <ns2:OrgId>
    <xsl:value-of select="VALUE"/>
    </ns2:OrgId>
    </xsl:if>
    </xsl:for-each>
    <xsl:for-each select="/imp1:WF_EVENT_T/PARAMETER_LIST/PARAMETER_LIST_ITEM">
    <xsl:if test='NAME = "ECX_PARTY_ID"'>
    <ns2:ECXPartyId>
    <xsl:value-of select="VALUE"/>
    </ns2:ECXPartyId>
    </xsl:if>
    </xsl:for-each>
    <xsl:for-each select="/imp1:WF_EVENT_T/PARAMETER_LIST/PARAMETER_LIST_ITEM">
    <xsl:if test='NAME = "ECX_PARTY_SITE_ID"'>
    <ns2:ECXPartySiteId>
    <xsl:value-of select="VALUE"/>
    </ns2:ECXPartySiteId>
    </xsl:if>
    </xsl:for-each>
    </ns2:HCNPOWFEVENT>
    </xsl:template>
    </xsl:stylesheet>
    Any ideas on how this can be achieved ?

    Ok I was able to get fileadapter filenames modified.
    First you cannot do this after a dbadapter query as that functionality seems to be broken. The best way to solve it for me was to simplify the problem, I started with placing the setoutbound header data after reading a simple file and ignoring the files content altogether. I do the set inside a match of the xslt using a constant value, again for simplicity. For the test just put in 'ateststring.txt' in the setoutbound header call, no need to select data from the document at this point; we will get to that. Now get that to work.
    Once you have that working take a value from the incoming document and select it into a variable named myvariable then replace the 'ateststring.txt' with $myvariable. So basically its a three step process for the final solution. Select the data of interest from the document into a variable. add a select statement to make the method call just after that. Make the method call inside the select statement and prepend the variable name with the $ symbol.
    So far I have only tested this file to file and file to ftp, I suspect that jmsadapter to file will work fine too. So the trick for me was to understand that if an incoming document is the result of a query that just wont do. My requirement was to take an input JMS request, use that to drive a query, take the data from the query and write it to a filename as defined in the JMS request. No matter what I did to set the frustrating fileadapter/ftpadapter filename in the header I was unable to do so. I used constant strings etc in every part of the document ( before select, inside select, outside select etc ). It wasnt until I went file to file that I was able to get this to work at all. And then not in the xslt header etc, it MUST be in an area of the document that resulted in a select match, which after review makes sense.
    To work around the query to file issue, I place the results of the data query into a temporary filename%SEQ%.tmp, along with the query results I add the real filename inside the document. I have a file listener that listens for the filename using wildcards filename*.tmp, it takes the file reads it in, pulls the permanent filename from the incoming document, and sets that filename in the header using the steps worked out above by selecting the filename into myvariable.
    You cannot ( to my knowlege ) store variables in ESB so I found I had to put them inside the documents to move the data around. When I am all done with the work through the routing service I strip out the variable data fields that I needed to carry along with the data.
    Please let me know how you are going with this, I hope this saves someone else a bit of frustration.
    Thanks again,
    John

  • Open dataset filename for output in text mode encoding default

    Hi,
    When I excute this command I get a sy-subrc = 0, but no file is created. This happens in an ECC 6.0 system. In 4.6C works ok.
    filename has the following structure '
    server\directory\filename'
    What am I doing wrong??
    Thank you very much for your your help.
    Regards.

    Hi,
    Can u tell what syntax u have written for open statement.
    In programs with active Unicode check, you must specify the access type (such as ... FOR INPUT, ... FOR OUTPUT, and so on) and the mode (such as ... IN TEXT MODE, ... IN BINARY MODE, and so on). If the file is opened using ... IN TEXT MODE, you must still use the addition ... ENCODING. If the Unicode check is enabled, it is possible to use file names containing blanks.
    Regards,
    Sruthi

  • Is It possible to give custom name for output files in Bursting

    Hi ,
    I am using bursting for mailing the output and PDF files are coming with names such as xdo1_null.pdf can the name be changed to invoice.pdf ..etc
    Thanks in advance
    Best Regards,
    Mahesh

    sample file, you can use any name and append the xml data elements too...
    <?xml version="1.0" encoding="UTF-8"?>
    <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type ="bursting">
    <xapi:request select="/MODULE1/LIST_G_EMPNO/G_EMPNO">
    <xapi:delivery>
    <xapi:email id ="123" server="[email protected]" port="25"
    from="[email protected]" reply-to="[email protected]">
    <xapi:message id="123" to="[email protected]" cc="" attachment="true"
    content-type="text/html" subject="Purchase Order Number: ${EMPNO}">Please
    see attached Purchase Order File: ${EMPNO}</xapi:message>
    </xapi:email>
    </xapi:delivery>
    <xapi:document output="PO_${EMPNO}" output-type="pdf" delivery="123">
    <xapi:template type="rtf" location="xdo://CUS.TEST_BURST_1.en.US/?getSource=true"
    filter=""></xapi:template>
    </xapi:document>
    </xapi:request>
    </xapi:requestset>
    Edited by: Sattti on Nov 2, 2008 8:26 PM

  • Custom filename for web module

    Is there a way to change the image filename when exporting through a web engine? Looking at the SDK documentation, I'd say there is not?
    If there was, I assume it would be part of the data model in lightroom.Application.property? It would be great if I could just use the renamingTokensOn there.
    The other related thing I found was the imageProxy exportFilename, but that can't be altered if I understand this correctly.
    Any comments much appreciated (I'm new to the SDK, please be gentle).
    Stefan

    You will get SD standard reports at following reports.
    http://help.sap.com/saphelp_nw70/helpdata/en/8f/36f338472b420de10000000a114084/frameset.htm
    http://wiki.sdn.sap.com/wiki/display/BI/BWSDMMFIDATASOURCES
    SD 
    Data sources Tables
    2LIS_11_VAKON VBUK, VBUP, VBAK, VBAP, VBKD, KOMV, T001.
    2LIS_11_VAHDR VBAK, VBUK, T001
    2LIS_11_VAITM VBAP, VBUP, VBAK, VBKD, VBAJP, T001, VBUK, PRPS.
    2LIS_11_VASCL VBAP, VBUP, VBAK, VBEP, VBKD, T001, PRPS
    2LIS_11_VASTH VBUK
    2LIS_11_VASTI VBUP, VBUK
    2LIS_11_V_ITM VBAP, VBAK, VBKD, VBUP, T001, PRPS, VBUK.
    2LIS_11_V_SCL VBUP, VBEP, VBKD, VBAP, VBAK, T001, PRPS.
    2LIS_11_V_SSL VBAP, VBEP, LIPS, WVBEP, VBUP
    2LIS_13_VDKON VBUK, VBRP, KOMV, T001, VBRK
    Regards,
    rvc

  • Variable filename for output

    Hey all,
    I want to have the file I spool to in a sql script to change depending on the database I'm connecting to, but am unsure how to accomplish this. Can this be done? Can someone provide an example?

    an alternative is to use a recent client and the predefined variable
    $ export NLS_DATE_FORMAT='YYYY-MM-DD_HH24-MI-SS'
    $ sqlplus scott/tiger
    SQL*Plus: Release 10.2.0.2.0 - Production on Thu May 8 13:25:03 2008
    Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> spool file_&_CONNECT_IDENTIFIER._&_DATE..txt
    SQL> prompt hello
    hello
    SQL> spo
    currently spooling to file_TINF4_2008-05-08_13-25-43.txt
    SQL> spool offThe main advantage is that you do not need to execute a query, so the file will be created with the right name even if the instance is not mounted and it will not generated an ORA- error if you are not connected
    up2u

  • Invoice Split for same customer but for different output types

    Hi Gurus,
    I have a requirement from the customers. A new output type has to be created with reference to the old type and for this output type a new driver program and SAP script was created with reference to the old one.They wants  invoice split to be happened based on item level PO number. That was done successfully.
    This invoice split logic  was written in the billing routine  RV60C901(Customized).
    But now they came back with a issue that the invoice split  should be done  only if they use the new output  type but not for the old one. That means for the same customer for one output type invoice split should be done based on item level po number and for one output type it should not. How can this be controlled for a particular
    output type?
    This output types will not be used in the billing routine as the split happens at the sales order level. Is there any configuration that allows split for a particular output type.
    Please suggest me how to proceed???

    Hi,
    In the invoice split routine check if it is possible to find the output type making use of field symbols.
    Just check in debug if the variable for output type is available as follows:-
    (Program Name)variable name.
    Regads,
    Ankur Parab

  • Customs Documents for Export Declaration - Output

    Hi ,
    i have created Billing document in R3, in GTS customs docuement generated for that billing doc.
    when  i am Executing the message under Communication View  giving error message "Cannot execute; message P0350 is incomplete"
    Could you please let me know which config i missed out.
    and also when i am check the message message throwing as "Executor/sender has not been maintained in customs document xxxxxxxxx" please let me know where i need to maintain the Sender"
    I want to see print preview on sereen for Certificate of Origin (US) for customs document for export declaration.
    please guide me on this.
    Regards
    Tarun

    Hi,
    You can first identify the incomplete schema assigned to the message (P0350).
    SPRO -> Global Trade Services -> SAP Customs Management -> General Settings -> Communication Processes -> Define Messages for Communications.
    Once you have find the incomplete schema, review the configurations to find which field is missing. From the error message, it might be the processor for the customs document.
    SPRO -> Global Trade Services -> SAP Customs Management -> General Settings -> Document Structure -> Control incompleteness checks in Customs Shipments and Customs Declarations
    Wen

  • Change "SAPScript" email subject/body for External Send(5) for output type?

    Hello,
    I'm emailing a SAPscript form (converted to PDF) generated via Transmission Medium 5 (External send) for output type (EK00) and need to change email's subject and body of email created by SAP code.  Any suggestions on how to change email's subject and body?
    Thanks,
    Billy

    Also if u want to add a body to the mail.  See the below form (sub routine) which needs to be mentioned in NACE.  Either u can keep this routine in the driver program or u can put in separate report program.  All thing u need to is see the below code and mention the name of the program and form name in nace.  Double click on output type in nace. u will find a tab stripped screen in right.  In the screen u can see the first tab as 'General data'  and at the bottom a block with title 'Replacement of text symbols' can be seen.  There u need to pass this program name and form name.
    Execute ur program and test the result.
    FORM text_symbol_replace TABLES pt_lines  STRUCTURE tline
                              USING ps_thead  STRUCTURE thead
                                    ps_nast   STRUCTURE nast.
      DATA:
        lv_kunnr LIKE vbak-kunnr,          " AN0465 Add AKKUMA1 02/19/07
        lv_new_cursor_column LIKE sy-tabix," Cursor column
        lv_new_cursor_line   LIKE sy-tabix," Cursor row
        lv_changed,                        " Indicator
        lv_matnr     LIKE vbap-matnr,
        lv_vkorg     LIKE vbak-vkorg,
        lv_vtweg     LIKE vbak-vtweg,
        lv_desc(20),
        lv_name      TYPE thead-tdname,    " Name
        lt_lines     LIKE tline OCCURS 0 WITH HEADER LINE,
        lv_currentprogram LIKE sy-repid.   " Program Name
      DATA :
        ps_lines LIKE tline.               " Structure
      CONSTANTS:
        lc_int TYPE nast-nacha VALUE '5',  " External Send
        lc_comma TYPE c VALUE ','.         " Comma Separater
      DATA: BEGIN OF ls_fname,
              dsnam TYPE nast-dsnam,       " Spool Name
              dsuf1 TYPE nast-dsuf1,       " Spool Suffix1
              dsuf2 TYPE nast-dsuf2,       " Spool Suffix 2
            END OF ls_fname.
      FIELD-SYMBOLS: <lfs_nast> TYPE vnast.
      IF ps_nast-kschl EQ gc_zj17.
    Fetching vbak-kunnr.
        SELECT SINGLE kunnr                " Customer
                      vkorg
                      vtweg
                 INTO (lv_kunnr,lv_vkorg,
                       lv_vtweg)
                 FROM vbak
                WHERE vbeln EQ ps_nast-objky.
        IF sy-subrc EQ 0.
          SELECT SINGLE matnr INTO lv_matnr
           FROM vbap
             WHERE vbeln EQ ps_nast-objky.
        ELSE.
          IMPORT xvbak-kunnr TO lv_kunnr FROM MEMORY ID 'YSOLDTO'.
          IMPORT xvbak-vkorg TO lv_vkorg FROM MEMORY ID 'YSALESORG'.
          IMPORT xvbak-vtweg TO lv_vtweg FROM MEMORY ID 'YDISTCH'.
          IMPORT xvbap-matnr TO lv_matnr FROM MEMORY ID 'YMATERIAL'.
        ENDIF.
        IF sy-subrc EQ 0.
          CONCATENATE lv_matnr lv_vkorg lv_vtweg
           INTO lv_name.
          CALL FUNCTION 'READ_TEXT'
               EXPORTING
                    id                      = '0001'
                    language                = ps_nast-spras
                    name                    = lv_name
                    object                  = 'MVKE'
               TABLES
                    lines                   = lt_lines
               EXCEPTIONS
                    id                      = 1
                    language                = 2
                    name                    = 3
                    not_found               = 4
                    object                  = 5
                    reference_check         = 6
                    wrong_access_to_archive = 7
                    OTHERS                  = 8.
          IF sy-subrc = 0.
            CLEAR lv_desc.
            LOOP AT lt_lines.
              CONCATENATE lv_desc lt_lines-tdline
                     INTO lv_desc
                SEPARATED BY space.
            ENDLOOP.                       " LOOP AT lt_desc
            CONDENSE lv_desc.
          ENDIF.
        ENDIF.                            " AN0465 Add AKKUMA1 02/26/07
    Fetch Region.
        SELECT SINGLE name1 ort01               " City
          INTO (gv_name1, gv_ort01)
          FROM kna1
          WHERE kunnr EQ lv_kunnr.
        IF sy-subrc EQ 0.
          CONDENSE gv_ort01.
          CONCATENATE ':OC:'
                      gv_name1
                      gv_ort01
                      lv_desc
                 INTO ps_lines-tdline SEPARATED BY space.
          LOOP AT pt_lines.
            pt_lines-tdline =  ps_lines-tdline.
            MODIFY pt_lines.
            CLEAR pt_lines.
          ENDLOOP.
        ENDIF.                             " IF ps_nast-kschl EQ gc_z..
      ENDIF.                               " AN0465 Add AKKUMA1 02/19/07
    IF NO TEXT IS PROVIDED READ TEXT USING HEADER INFO
      IF pt_lines[] IS INITIAL AND NOT ps_thead IS INITIAL.
        CALL FUNCTION 'READ_TEXT'
             EXPORTING
                  id       = ps_thead-tdid
                  language = ps_thead-tdspras
                  name     = ps_thead-tdname
                  object   = ps_thead-tdobject
             TABLES
                  lines    = pt_lines
             EXCEPTIONS
                  OTHERS   = 1.
        IF sy-subrc NE 0.
        ENDIF.                             " IF sy-subrc NE 0.
      ENDIF.                               " IF pt_lines[] IS INITIAL
    REPLACE VARIABLES USING DATA FROM PROGRAM   YVADOR01
      IF NOT pt_lines[] IS INITIAL.
        lv_currentprogram = 'SAPMV45A'.
        CALL FUNCTION 'TEXT_SYMBOL_REPLACE'
             EXPORTING
                  endline = sy-tabix
                  header  = ps_thead
                  program = lv_currentprogram
             IMPORTING
                  changed = lv_changed
             TABLES
                  lines   = pt_lines.
    Subrc Check not required.
        CALL FUNCTION 'FORMAT_TEXTLINES'
             IMPORTING
                  new_cursor_column = lv_new_cursor_column
                  new_cursor_line   = lv_new_cursor_line
             TABLES
                  lines             = pt_lines
             EXCEPTIONS
                  OTHERS            = 2.
        IF sy-subrc NE 0.
          EXIT.
        ENDIF.                             " IF sy-subrc NE 0.
      ENDIF.                               " IF NOT pt_lines[] IS INITIAL
    SPLIT ORDER NUMBER AND PUT THEM INTO SPOOL REQUEST NAME & SUFFIX FIELD
    SAP USES THESE FIELDS TO CONSTRUCT FILENAME
    FOR THE PDF ATTACHMENT IN EMAIL
      IF ps_nast-nacha EQ lc_int OR ps_nast-nacha = '2'.
        IF ps_nast-dsnam IS INITIAL AND ps_nast-dsuf1 IS INITIAL.
          ls_fname = ps_lines-tdline.
          ps_nast-dsnam = ls_fname-dsnam.
          ps_nast-dsuf1 = ls_fname-dsuf1.
          ps_nast-dsuf2 = ls_fname-dsuf2.
        ENDIF.                             " IF ps_nast-dsnam IS INITIAL...
      ENDIF.                               " IF ps_nast-nacha EQ lc_int
    ENDFORM.                               " TEXT_SYMBOL_REPLACE
    Venkat.

  • How to Created custom report for Ship not Billed (SD/FI)?

    Hi all,
    I am anticipating  to write some abap reports..Here is one of them..
    Anyone can help  me with writing a Report , how to do 'Custom Report for shipped not Billed(SD/FI)' ..But since I am new to Abap , if you wish to reply, please use a little more detail and simple explanation, step by step so I can understand what is the idea, how it can be acheived...what kind of report should be used , techniques, tables etc...:)
    Appreciate your help!
    Regards,
    Boby

    Hi Boby,
    You need to create custom transaction to achive these results.
    you will have selection-screen ,it would be :
    Date : Here date would be mandatory  - Ranges Option
    Customer  - Optional field - Ranges
    Order #  Sales Order (Optional) Ranges
    Invoice #  - Invoice # (Optional) Ranges
    You will get the data based on ur selection-screen criteria ...
    First you will have customer order details from diffrent table
    VBAK,
    VBAP,
    LIKP
    LIPS
    VBRK,
    VBRP
    KNA1,
    VBFA Tables ( See the my sample program )
    Output would be :
    Customer #   Custome Name    Order #   Delivery #   Invoice #   Netpr, Netquantity ,
    Check the condition  whether invoice table has VBRK-RFBSK  = ''.
    See the my sample program : This is sales report by monthly..
    REPORT ZFDSALES_REPORT no standard page heading
                           message-id zwave.
    Data Declaration Part
    TYPE-POOLS
    type-pools : slis.
    Tables
    tables : VBAK,
             VBAP.
    Internal table for VBAK Table
    data : begin of i_vbak occurs 0,
           vbeln like vbak-vbeln,
           bstnk like vbak-bstnk,
           vdatu like vbak-vdatu,
           end of i_vbak.
    Internal table for VBAP and MATNR
    data : begin of i_vbap occurs 0,
           vbeln like vbap-vbeln,
           matnr like vbap-matnr,
           kdmat like vbap-kdmat,
           kwmeng like vbap-kwmeng,
           netpr like vbap-netpr,
           maktx like makt-maktx,
           end of i_vbap.
    Internal tables
    data : begin of i_sales occurs 0,
           vdatu like vbak-vdatu,
           bstnk like vbak-bstnk,
           matnr like vbap-matnr,
           maktx like makt-maktx,
           kdmat like vbap-kdmat,
           kwmeng like vbap-kwmeng,
           netpr  like vbap-netpr,
           end of i_sales.
    Variable for ALV
    data : v_repid like sy-repid,
           gt_fieldcat    type slis_t_fieldcat_alv.
    Selection-screen
    selection-screen : begin of block blk with frame title text-001.
    select-options : s_vbeln for vbak-vbeln,
                     s_erdat for vbak-erdat,
                     s_ernam for vbak-ernam,
                     s_vdatu for vbak-vdatu obligatory,
                     s_BSTNK for vbak-BSTNK,
                     s_KUNNR for vbak-kunnr,
                     s_matnr for vbap-matnr,
                     s_KDMAT for vbap-KDMAT.
    selection-screen : end of block blk.
    Initilization
    initialization.
      v_repid = sy-repid.
    S T A R T  -  O F  -  S E L E C T I O N ****************
    start-of-selection.
    Get the data from VBAK and VBAP Tables
      perform get_vbak_vbap.
    E N D  -  O F  -  S E L E C T I O N *****************
    end-of-selection.
    Display the data
      perform dispolay_data.
    *&      Form  get_vbak_vbap
          Get the data from VBAK and VBAP Table
    FORM get_vbak_vbap.
    Get the data from VBAK Table
      select vbeln bstnk vdatu from vbak into table i_vbak
                         where vbeln in s_vbeln
                         and   bstnk in s_bstnk
                         and   vdatu in s_vdatu
                         and   kunnr in s_kunnr
                         and   erdat in s_erdat
                         and   ernam in s_ernam.
      if sy-subrc ne 0.
        message e000(zwave) with 'No data found for given selection'.
      endif.
    Get the data from VBAP Table
      select avbeln amatnr akdmat akwmeng a~netpr
             b~maktx into table i_vbap
             from vbap as a inner join makt as b on bmatnr = amatnr
             for all entries in i_vbak
             where a~vbeln in s_vbeln
             and   a~kdmat in s_kdmat
             and   a~abgru = space
             and   a~matnr in s_matnr
             and   a~matnr ne '000000000000009999'
             and   a~matnr ne '000000000000004444'
             and   a~matnr ne '000000000000008888'
             and   a~matnr ne '000000000000001111'
             and   a~werks = '1000'
             and   b~spras = 'E'
             and   a~vbeln = i_vbak-vbeln.
      if sy-subrc ne 0.
        message e000(zwave) with 'No data found for given selection'.
      endif.
      sort i_vbak by vbeln.
      sort i_vbap by vbeln matnr.
      loop at i_vbap.
        read table i_vbak with key vbeln = i_vbap-vbeln
                                binary search.
        if sy-subrc eq 0.
          i_sales-bstnk = i_vbak-bstnk.
          i_sales-vdatu = i_vbak-vdatu.
          i_sales-matnr = i_vbap-matnr.
          i_sales-kdmat = i_vbap-kdmat.
          i_sales-maktx = i_vbap-maktx.
          i_sales-netpr = i_vbap-netpr.
          i_sales-kwmeng = i_vbap-kwmeng.
          append i_sales.
        else.
          continue.
        endif.
        clear : i_sales,
                i_vbap,
                i_vbak.
      endloop.
      sort i_sales by vdatu bstnk matnr.
      refresh : i_vbap,
                i_vbak.
    ENDFORM.                    " get_vbak_vbap
    *&      Form  dispolay_data
          Display the data
    FORM dispolay_data.
    Fill the Fiedlcat
      PERFORM fieldcat_init  using gt_fieldcat[].
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                =
      I_BUFFER_ACTIVE                   = ' '
          I_CALLBACK_PROGRAM                = v_repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
          IT_FIELDCAT                       = gt_fieldcat[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      IT_ALV_GRAPHICS                   =
      IT_ADD_FIELDCAT                   =
      IT_HYPERLINK                      =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
      IT_EXCEPT_QINFO                   =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = i_sales
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
    ENDFORM.                    " dispolay_data
    *&      Form  fieldcat_init
          text
         -->P_GT_FIELDCAT[]  text
    FORM fieldcat_init USING  e01_lt_fieldcat type slis_t_fieldcat_alv.
      DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    Delivery Date
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'VDATU'.
      LS_FIELDCAT-OUTPUTLEN    = 12.
      LS_FIELDCAT-TABNAME    = 'I_SALES'.
      ls_fieldcat-seltext_L = 'Delivery Date'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Purchase Order #Material Description
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'BSTNK'.
      LS_FIELDCAT-OUTPUTLEN    = 25.
      LS_FIELDCAT-TABNAME    = 'I_SALES'.
      ls_fieldcat-seltext_L = 'Purchase Order #'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Material
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-REF_FIELDNAME    = 'MATNR'.
      LS_FIELDCAT-REF_TABNAME    = 'MARA'.
      LS_FIELDCAT-FIELDNAME    = 'MATNR'.
      LS_FIELDCAT-TABNAME    = 'I_SALES'.
      ls_fieldcat-seltext_L = 'Material #'.
      ls_fieldcat-seltext_M = 'Material #'.
      ls_fieldcat-seltext_S = 'Material #'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Material Description
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'MAKTX'.
      LS_FIELDCAT-OUTPUTLEN    = 40.
      LS_FIELDCAT-TABNAME    = 'I_SALES'.
      ls_fieldcat-seltext_L = 'Material Description'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Customer Material #
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'KDMAT'.
      LS_FIELDCAT-OUTPUTLEN    = 35.
      LS_FIELDCAT-TABNAME    = 'I_SALES'.
      ls_fieldcat-seltext_L = 'Customer material no.'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Quantity
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'KWMENG'.
      LS_FIELDCAT-OUTPUTLEN    = 15.
      LS_FIELDCAT-TABNAME    = 'I_SALES'.
      ls_fieldcat-seltext_L = 'Quantity'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    Net Price
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'NETPR'.
      LS_FIELDCAT-OUTPUTLEN    = 15.
      LS_FIELDCAT-TABNAME    = 'I_SALES'.
      ls_fieldcat-seltext_L = 'Net Price'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    ENDFORM.                    " fieldcat_init
    Reward Points if it is helpful
    Thanks
    Seshu

  • Error for output tax code:Tax code I4 may only contain one assignment line.

    Hi
    While posting customer invoice with output tax code, I am getting following error.
    Tax code I4 may only contain one assignment line.
    Please help me resolve.
    Regards
    Rekha

    There are quite some answered questions in this forum for this issue.
    Here is one.
    Error in Sample document (Message no. FF731)
    Also, please search the forum with the following search key words.
    Tax AND code AND may AND only AND contain AND one AND assignment AND line
    Make sure you select all posts, not just the past 90 days (the default option), and you will see quite some hits.

Maybe you are looking for