How to add the records of 2 internal table records into one file

hello experts,
My scenario is...
I am retrieving the data for the for the credit, debit and trailer records of the customer into 3 different internal tables and finally i have to append all those records into one file first debit records then credit records finally the trailer record.... how to do that can anyone give some idea plzzzzzzzzz..
Plz its bit urgent..
Thanks a lot for your anticipation
SRI

Hello,
Do like this.
" Assume u have three itab.
"Itab1 - debit
"Itab2 - credit
"Itab3 - Credit.
REPORT ZV_TEST_SERVER .
*PARAMETERS: P_FILE TYPE STRING."RLGRAP-FILENAME.
CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
*   BIN_FILESIZE                  =
    FILENAME                      = P_FILE
*   FILETYPE                      = 'ASC'
   APPEND                        = 'X'  " Check here
*   WRITE_FIELD_SEPARATOR         = ' '
*   HEADER                        = '00'
*   TRUNC_TRAILING_BLANKS         = ' '
*   WRITE_LF                      = 'X'
*   COL_SELECT                    = ' '
*   COL_SELECT_MASK               = ' '
*   DAT_MODE                      = ' '
* IMPORTING
*   FILELENGTH                    =
  TABLES
    DATA_TAB                      = ITAB1
* 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
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
*   BIN_FILESIZE                  =
    FILENAME                      = P_FILE
*   FILETYPE                      = 'ASC'
   APPEND                        = 'X'  " Check here
*   WRITE_FIELD_SEPARATOR         = ' '
*   HEADER                        = '00'
*   TRUNC_TRAILING_BLANKS         = ' '
*   WRITE_LF                      = 'X'
*   COL_SELECT                    = ' '
*   COL_SELECT_MASK               = ' '
*   DAT_MODE                      = ' '
* IMPORTING
*   FILELENGTH                    =
  TABLES
    DATA_TAB                      = ITAB2  " Check here
* 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
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
*   BIN_FILESIZE                  =
    FILENAME                      = P_FILE
*   FILETYPE                      = 'ASC'
   APPEND                        = 'X'  " Check here
*   WRITE_FIELD_SEPARATOR         = ' '
*   HEADER                        = '00'
*   TRUNC_TRAILING_BLANKS         = ' '
*   WRITE_LF                      = 'X'
*   COL_SELECT                    = ' '
*   COL_SELECT_MASK               = ' '
*   DAT_MODE                      = ' '
* IMPORTING
*   FILELENGTH                    =
  TABLES
    DATA_TAB                      = ITAB3 " Check here
* 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
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
If useful reward.
Vasanth

Similar Messages

  • How to drop the contents on an internal table?

    Dear all,
    can some one suggest me the code to drop the content of an internal table.
    VJ

    Following are the different ways of DELETIONS from ITAB, DTAB and FILE:
    DELETE FROM dbtab       WHERE cond.
    DELETE FROM (dbtabname) WHERE cond.
    - DELETE dbtab.
    DELETE *dbtab.
    DELETE (dbtabname) ... .
    - DELETE dbtab       FROM TABLE itab.
    DELETE (dbtabname) FROM TABLE itab.
    - DELETE dbtab  VERSION vers.
    DELETE *dbtab VERSION vers.
    Delete from an internal table
    - DELETE itab.
    - DELETE itab INDEX idx.
    - DELETE itab FROM idx1 TO idx2.
    - DELETE itab WHERE cond.
    - DELETE ADJACENT DUPLICATES FROM itab.
    Delete a program
    - DELETE REPORT prog.
    Delete text elements
    - DELETE TEXTPOOL prog LANGUAGE lg.
    Delete a data cluster from a database table
    - DELETE FROM DATABASE dbtab(ar) ...ID key.
    Delete a data cluster from the cross-transaction application buffer
    - DELETE FROM SHARED BUFFER dbtab(ar) ...ID key.
    Delete a file
    - DELETE DATASET dsn.
    Delete a screen
    - DELETE DYNPRO f.
    Thanks,
    Santosh

  • How to download internal table data into xml file?

    Hi,
    Experts,
    I have downloaded internal table data into XLS format using GUI_DOWNLOAD Function module, But i didn't Know how to download internal table data into XML format please post some ideas/inputs on this issue.
    Thank you,
    Shabeer ahmed.

    check this
    data : gd_repid type sy-repid.
    GD_REPID = SY-REPID.
    DATA : L_DOM TYPE REF TO IF_IXML_ELEMENT,
           M_DOCUMENT TYPE REF TO IF_IXML_DOCUMENT,
           G_IXML TYPE REF TO IF_IXML,
           W_STRING TYPE XSTRING,
           W_SIZE TYPE I,
           W_RESULT TYPE I,
           W_LINE TYPE STRING,
           IT_XML TYPE DCXMLLINES,
           S_XML LIKE LINE OF IT_XML,
           W_RC LIKE SY-SUBRC.
    DATA: XML TYPE DCXMLLINES.
    DATA: RC TYPE SY-SUBRC,
          BEGIN OF XML_TAB OCCURS 0,
          D LIKE LINE OF XML,
          END OF XML_TAB.
    data : l_element           type ref to if_ixml_element,
           xml_ns_prefix_sf     type string,
           xml_ns_uri_sf        type string.
    CLASS CL_IXML DEFINITION LOAD.
    G_IXML = CL_IXML=>CREATE( ).
    CHECK NOT G_IXML IS INITIAL.
    M_DOCUMENT = G_IXML->CREATE_DOCUMENT( ).
    CHECK NOT M_DOCUMENT IS INITIAL.
    CALL FUNCTION 'SDIXML_DATA_TO_DOM'
    EXPORTING
       NAME = 'REPAIRDATA'
       DATAOBJECT = IT_FINAL_LAST1[]
    IMPORTING
       DATA_AS_DOM = L_DOM
    CHANGING
       DOCUMENT = M_DOCUMENT
    EXCEPTIONS
       ILLEGAL_NAME = 1
       OTHERS = 2.
    CHECK NOT L_DOM IS INITIAL.
    W_RC = M_DOCUMENT->APPEND_CHILD( NEW_CHILD = L_DOM ).
    *Start of code for Header
    * namespace
    t_mnr = sy-datum+4(2).
    CALL FUNCTION 'IDWT_READ_MONTH_TEXT'
      EXPORTING
        LANGU         = 'E'
        MONTH         = t_mnr
    IMPORTING
       T247          = wa_t247
    concatenate sy-datum+6(2)
                wa_t247-ktx
                sy-datum(4) into t_var1.
    concatenate sy-uzeit(2)
                sy-uzeit+2(2)
                sy-uzeit+4(2) into t_var2.
    clear : xml_ns_prefix_sf,
            xml_ns_uri_sf.
    l_element  = m_document->get_root_element( ).
    xml_ns_prefix_sf = 'TIMESTAMP'.
    concatenate t_var1 t_var2 into xml_ns_uri_sf separated by space.
    clear : t_var1,
            t_var2,
            t_mnr,
            wa_t247.
    l_element->set_attribute( name  = xml_ns_prefix_sf
                              namespace = ' '
                              value = xml_ns_uri_sf ).
    clear : xml_ns_prefix_sf,
            xml_ns_uri_sf.
    xml_ns_prefix_sf  = 'FILECREATOR'.
    xml_ns_uri_sf    =   'SAP'.
    l_element->set_attribute( name  = xml_ns_prefix_sf
                              namespace = ' '
                              value = xml_ns_uri_sf ).
    clear : xml_ns_prefix_sf,
            xml_ns_uri_sf.
    xml_ns_prefix_sf  = 'CLAIMGROUP'.
    xml_ns_uri_sf    = '1'.
    l_element->set_attribute( name  = xml_ns_prefix_sf
                              namespace = ' '
                              value = xml_ns_uri_sf ).
    clear : xml_ns_prefix_sf,
            xml_ns_uri_sf.
    xml_ns_prefix_sf  = 'CLAIMTYPES'.
    xml_ns_uri_sf    = 'W'.
    l_element->set_attribute( name  = xml_ns_prefix_sf
                              namespace = ' '
                              value = xml_ns_uri_sf ).
    *End of Code for Header
    CALL FUNCTION 'SDIXML_DOM_TO_XML'
    EXPORTING
      DOCUMENT = M_DOCUMENT
    IMPORTING
      XML_AS_STRING = W_STRING
      SIZE = W_SIZE
    TABLES
      XML_AS_TABLE = IT_XML
    EXCEPTIONS
      NO_DOCUMENT = 1
      OTHERS = 2.
    LOOP AT IT_XML INTO XML_TAB-D.
    APPEND XML_TAB.
    ENDLOOP.
    *Start of Code for File name
    concatenate p_file
                '\R'
                '000_119481'
                sy-datum+6(2) sy-datum+4(2) sy-datum+2(2)
                sy-uzeit(2)   sy-uzeit+2(2) sy-uzeit(2) '.xml' into p_file.
    *End of Code for File name
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
      BIN_FILESIZE = W_SIZE
      FILENAME = p_file
      FILETYPE = 'BIN'
    TABLES
      DATA_TAB = XML_TAB
    EXCEPTIONS
      OTHERS = 10.
    IF SY-SUBRC  = 0.
                  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • How to log the messages in an internal table n display

    Hello guys,
    This is my first post in SDN.
    I am uploading some data from application server. I am doing lot of varifications, based on that I have to display the messages.
    So I asked not to use the write statements to display the messages but asked me to create an internal table and display the messages afterwards..
    like I am using some BAPI to upload after the bapi call i have to log the result for each record into an internal table and show...
    can anyone guide me how to do it?

    Thanks for your info Azad,
    here I am posting my code... can u go through it once and lemme me whether i am in right track or not?
    FORM FORM_POST_DATA.
      IF X_POST = 'X'.
        CALL FUNCTION 'BAPI_ACC_BILLING_POST'
          EXPORTING
            DOCUMENTHEADER          = WA_DOCUMENTHEADER
           CUSTOMERCPD             = WA_CUSTOMERCPD
    IMPORTING
      OBJ_TYPE                =
      OBJ_KEY                 =
      OBJ_SYS                 =
          TABLES
            ACCOUNTRECEIVABLE       = IT_ACCOUNTRECEIVABLE
            ACCOUNTGL               = IT_ACCOUNTGL
            ACCOUNTTAX              = IT_ACCOUNTTAX
      CRITERIA                =
      VALUEFIELD              =
            CURRENCYAMOUNT          = IT_CURRENCYAMOUNT
            RETURN                  = IT_RETURN
      SALESORDER              =
      SALESAMOUNT             =
           EXTENSION1              = IT_EXTENSION1
        LOOP AT IT_RETURN.
          MOVE-CORRESPONDING IT_RETURN TO IT_MESSAGES.
        ENDLOOP.
      ENDIF.
    WRITE: / 'Result of Post:'.
      WRITE : / REF_TYPE,REF_KEY,REF_SYS.
      PERFORM FORM_SHOW_MESSAGES.
    ENDFORM.              "FORM_POST_DATA
    FORM FORM_SHOW_MESSAGES.
      IF IT_RETURN[] IS INITIAL.
        WRITE: / 'no messages'.
      ELSE.
        SKIP 1.
        LOOP AT IT_RETURN.
          WRITE: /    IT_RETURN-TYPE,
                 (2)  IT_RETURN-ID,
                      IT_RETURN-NUMBER,
                 (80) IT_RETURN-MESSAGE,
                    IT_RETURN-LOG_NO
                    IT_RETURN-LOG_MSG_NO
                    IT_RETURN-MESSAGE_V1
                    IT_RETURN-MESSAGE_V2
                    IT_RETURN-MESSAGE_V3
                    IT_RETURN-MESSAGE_V4
                 (20) IT_RETURN-PARAMETER,
                 (3)  IT_RETURN-ROW,
                      IT_RETURN-FIELD.
                    IT_RETURN-SYSTEM
        ENDLOOP.
      ENDIF.
      ULINE.
    ENDFORM.                               " Show_messages
    Nisha...

  • How to delete the data inside a internal table?

    I got a internal table name g_itab1.
    currently my g_itab1 has a FNAME(50) component.
    Inside my component there is ADMINO, EYEAR, FIRSTNAME, LASTNAME and CONTACT.
    I want to clear away ADMINO, EYEAR, FIRSTNAME, LASTNAME and CONTACT inside my internal table.
    How do i clear it? i have tried using CLEAR g_itab1.
    It doesn't work.. the data are still inside.

    hi
                    DELETE TABLE itab WITH TABLE KEY k1 = v1 ... kn = vn.
    Example to delete all of the lines between 5 and 36 in a table of names where the entry begins with one of the letters 'A' to 'C'.
             DELETE  itab  FROM 5 TO 36 WHERE NAME CA 'ABC'.
    reward if useful
    regards
    sree

  • How to read the data from an internal table,when column names are known

    Hi All
    I have a specific requirement. I got an internal table with many fields (let it be my_tab).  Some of the fieldnames (column names in internal table my_tab) are stored in separate internal table(let it be my_fields).
    I need to store/read data corresponding to the fields (whose name is stored in my_fields) from my_tab.
    I am able to build dynamic table (referred by field-symbol) with respect to the given field names in my_fields.
    But i am unable to read the data corresponding to the fieldnames from my_tab.
    Please provide  me some pointer in this regard.
    Regards
    Swetabh Shukla

    HI All
    Thanks for the prompt response. I got solution for my question. Please check below thread. For quick reponse i posted my question in one more category. Thanks to all of you.
    How to read internal table w.r.t. fieldnames stored in other table

  • How to pass the contents of an internal table to the IDoc FIDCC2?

    Hi,
    I have an internal table. Using its contents, I have to create an Idoc and do GL posting.
    I have to use FIDCC2 Idoc and the function module IDOC_INPUT_FIDCC2.
    Can u please let me know how to pass the contents of the internal table into the idoc FIDCC2 and do the GL posting?
    Regards,
    Balaji. R

    Hi balaji,
    use function IDOC_INBOUND_FROM_FILE. This will do half the process.
    Documentation is missing, but program RSEINB00 explains something,
    also some links
    [http://help.sap.com/saphelp_nw70/helpdata/EN/dc/6b7f1543d711d1893e0000e8323c4f/frameset.htm]
    [RSEINB00 does not work in background]
    [RSEINB00 flat file to idoc uploading in XI]
    [Loading flat idoc via report RSEINB00 into integration server fails]
    Hope it helps.
    Regards,
    Clemens

  • How to ADD rows to a dynamic internal table??

    My question is simple.
    I have a dynamic internal table and I need to ADD rows to if.
    I read this thread How to modify a dynamic internal table from dynamic work area but they are modifying existing data.
    My internal table is EMPTY and I need to ADD new rows, so I can't use LOOP ASSIGNING.
    How can I do that?
    Any help is welcome!
    Thanks!
    Bettina

    Hi,
      try something similar.
    FIELD-SYMBOLS: <fs> type any.
    FIELD-SYMBOLS: <f1> type any.
    ASSIGN INITIAL LINE TO lo_data ASSIGNING <fs>. " or <f_tab> - not sure w/o editor :-)
    assigning component 1 of structure <fs> to <f1>.
    <f1> = 'aaa'.
    I write it from memory so there can be some syntax errors but focus to command APPEND INITIAL LINE ...
    Regards,
      Karol

  • REUSE_ALV_GRID_DISPLAY , how to pass the 'tick' button to internal table

    hi all i have coded:
    DATA: BEGIN OF itab OCCURS 0,
          vbeln LIKE vbak-vbeln,
          posnr LIKE vbap-posnr,
          chk(1),
         END OF itab.
    SELECT vbeln
           posnr
           FROM vbap
           UP TO 20 ROWS
           INTO TABLE itab.
    x_fieldcat-fieldname = 'CHK'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-col_pos = 1.
    x_fieldcat-input = 'X'.
    x_fieldcat-edit = 'X'.
    x_fieldcat-checkbox = 'X'.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'VBELN'.
    x_fieldcat-seltext_l = 'VBELN'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-col_pos = 2.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    x_fieldcat-fieldname = 'POSNR'.
    x_fieldcat-seltext_l = 'POSNR'.
    x_fieldcat-tabname = 'ITAB'.
    x_fieldcat-col_pos = 3.
    APPEND x_fieldcat TO it_fieldcat.
    CLEAR x_fieldcat.
    l_layout-window_titlebar = 'Popup window'.
    x_events-name = slis_ev_end_of_page.
    x_events-form = 'END_OF_PAGE'.
    APPEND x_events  TO it_events.
    CLEAR x_events .
    x_events-name = slis_ev_top_of_page.
    x_events-form = 'TOP_OF_PAGE'.
    APPEND x_events  TO it_events.
    CLEAR x_events .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program       = sy-repid
        is_layout                = l_layout
        i_callback_pf_status_set = 'STATUS'
        i_callback_user_command  = 'USER_COMMAND'
        it_fieldcat              = it_fieldcat
        it_events                = it_events
       I_SCREEN_START_COLUMN    = 10
       I_SCREEN_START_LINE      = 1
       I_SCREEN_END_COLUMN      = 50
       I_SCREEN_END_LINE        = 20
      TABLES
        t_outtab                 = itab
      EXCEPTIONS
        program_error            = 1
        OTHERS                   = 2.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    itab-chk is a check button, after execute for the second time, i need to get this ticked button to perform upload transaction..how to pass the ticked button inside itab ?

    just loop at itab and pass X to chk
    loop at itab into wa_itab.
       wa_itab-chk = 'X'.
       modify itab from wa_itab.
    endloop.

  • Two internal tables data into one

    Hello Gurus,
    I have data in two internal tables. One table IT_A contains the fields -
    MATNR - SALES ORG - DCHANNEL - STATUS - DESCRIPTION
    The other table IT_B contains the fields -
    CUSTOMER - SALES ORG.
    I need to display the result of all the fields when the sales org of both the tables are equal. i.e IT_A-VKORG = IT_B-VTORG.
    MATNR - SALES ORG - DCHANNEL - STATUS - DESCRIPTION.
    Please help me out with the code to be written.
    Regards,
    Balu

    TABLES    : MVKE, CAUFVD, TVMST.
    TYPES     : BEGIN OF T_MVKE,
                MATNR TYPE MVKE-MATNR,
                VKORG TYPE MVKE-VKORG,
                VTWEG TYPE MVKE-VTWEG,
                VMSTA TYPE MVKE-VMSTA,
                VMSTB TYPE TVMST-VMSTB,
                END OF T_MVKE.
    DATA      : LT_MVKE TYPE STANDARD TABLE OF T_MVKE WITH HEADER LINE,
                LS_MVKE TYPE T_MVKE.
    DATA      : LT1_MVKE TYPE STANDARD TABLE OF T_MVKE WITH HEADER LINE,
                LS1_MVKE TYPE T_MVKE.
    DATA      : LT2_MVKE TYPE STANDARD TABLE OF T_MVKE WITH HEADER LINE,
                LS2_MVKE TYPE T_MVKE.
    TYPES     : BEGIN OF T_KNVP,
                KUNNR TYPE KNVP-KUNNR,
                VKORG TYPE KNVP-VKORG,
                END OF T_KNVP.
    DATA      : LT_KNVP TYPE STANDARD TABLE OF T_KNVP WITH HEADER       LINE,
                LS_KNVP TYPE T_KNVP.
    SELECT-OPTIONS S_MATNR FOR MVKE-MATNR.
    PARAMETER  : P_KUNNR TYPE KNVP-KUNNR .
    START-OF-SELECTION.
    SELECT MATNR VKORG VTWEG VMSTA FROM MVKE INTO TABLE LT_MVKE WHERE MATNR IN S_MATNR .
    IF SY-SUBRC = 0.
    APPEND LT_MVKE.
    ELSE.
    EXIT.
    ENDIF.
    SELECT DISTINCT KUNNR VKORG FROM KNVP INTO TABLE LT_KNVP WHERE KUNNR = P_KUNNR.
    IF SY-SUBRC = 0.
    APPEND LT_KNVP.
    ELSE.
    EXIT.
    ENDIF.
    LOOP AT LT_MVKE.
    LT1_MVKE-MATNR = LT_MVKE-MATNR.
    LT1_MVKE-VKORG = LT_MVKE-VKORG.
    LT1_MVKE-VTWEG = LT_MVKE-VTWEG.
    LT1_MVKE-VMSTA = LT_MVKE-VMSTA.
    SELECT SINGLE VMSTB FROM TVMST INTO LT1_MVKE-VMSTB WHERE VMSTA = LT_MVKE-VMSTA AND SPRAS = SYST-LANGU.
    APPEND LT1_MVKE.
    CLEAR LT1_MVKE.
    ENDLOOP.
    LOOP AT LT1_MVKE.
      IF NOT LT_KNVP[] is INITIAL.
      READ TABLE LT_KNVP WITH KEY VKORG = LT1_MVKE-VKORG BINARY SEARCH TRANSPORTING NO FIELDS.
       IF SY-SUBRC = 0.
       APPEND LT1_MVKE TO LT2_MVKE.
       ELSE.
       APPEND LT1_MVKE TO LT2_MVKE.
       MESSAGE S003.
       ENDIF.
      CLEAR LT1_MVKE.
      ELSE. "IF LT_KNVP[] IS INITIAL.
       APPEND LT1_MVKE TO LT2_MVKE.
    ENDIF.
    ENDLOOP.
    WRITE: /1 'MATERIAL NUMBER', 20 'SALES ORG', 35 'DISTRIBUTION CHANNEL', 65 'MATERIAL STATUS', 85 'STATUS DESCRIPTION'.
    LOOP AT LT2_MVKE.
    FORMAT HOTSPOT ON.
    WRITE: /1 LT2_MVKE-MATNR, 20 LT2_MVKE-VKORG, 35 LT2_MVKE-VTWEG, 65 LT2_MVKE-VMSTA, 85 LT2_MVKE-VMSTB.
    HIDE: LT2_MVKE-MATNR, LT2_MVKE-VKORG, LT2_MVKE-VTWEG, LT2_MVKE-VMSTA, LT2_MVKE-VMSTB.
    CLEAR LT2_MVKE.
    FORMAT HOTSPOT OFF.
    ENDLOOP.
    AT LINE-SELECTION.
      IF LT2_MVKE-VMSTA = ' '.
       MESSAGE E002.
    ELSE.
    SET PARAMETER ID 'MAT' FIELD LT2_MVKE-MATNR.
    CALL TRANSACTION 'CO09'.
    DATA WERKS(4) TYPE C VALUE '1200'.
    SET PARAMETER ID 'WRK' FIELD WERKS.
    DATA RULE(2) TYPE C VALUE 'ZB'.
    SET PARAMETER ID 'PRR' FIELD RULE.
    SET PARAMETER ID 'X' FIELD CAUFVD-PRMBD.
    ENDIF.
    Hello gurus,
    The above code is working fine when I give both Material and customer in the select options. But it is not doing anything when I enter only the material.
    Please help.
    Regards,
    Balu

  • How to fix the position of controls, so table expands into whitespace and doesn't push lower controls down (invoice report in SSRS 2005)

    I am designing an invoice report. There are some controls at the top of the report (company logo, date, invoice number etc), followed by a table listing the items in the invoice, followed by some controls at the bottom (subtotals, returns address etc). The report should always print onto a single page.
    I want the controls at the bottom to have a fixed position on the page. There is sufficient whitespace between these controls and the table above for the table to expand to list many items. However whenever it expands it pushes the lower controls down. This results in them spilling onto a second page.
    Is there a way to fix the position of controls and suppress the "gets pushed down when controls above expand" effect?

    Thanks for that. I found a good solution using rectangles here: SQL Server 2005: Report Design Best Practices and Guidelines
    Here's the relevant part (see underlining):
    Using Rectangles to Keep Objects Together
    Rectangles in Reporting Services can be used either as graphical elements or as containers of objects. As object containers, they keep objects together on a page and control how object move and push each other.
    To keep multiple objects together on a page, put the objects within a rectangle. You can then put a page break before or after the rectangle by using the PageBreakAtStart or PageBreakAtEnd properties for the rectangle.
    Using Rectangles to Control Item Growth and Displacement
    Items within a rectangle become peers of each other and are governed by the rules of how peer items are positioned on the page as they move or grow. For example:
    Items will push or displace each other within the rectangle.
    Items will not push or displace items outside the rectangle, because they are not their peers.
    If necessary, a rectangle will grow to accommodate the items it contains.
    You can use this logic to your advantage when dealing with objects that expand. For example:
    If you want to leave a blank space in your report for a table to expand into, group the blank space and the table in the same rectangle. When the table grows, it will push the blank space .
    If you want to prevent a matrix from pushing items off the right edge of the page, put the matrix within a rectangle with blank space to its right. Now, the matrix is no longer a peer to the other item on the page and will not be able to push it until the matrix can no longer be contained within its rectangle.

  • How to convert the source code in JSP,HTML&BEANS into executable files?

    Sir,
    We are developing one s/w product in JSP,HTML&BEANS.Now we are in the implementation phase.During the time of Installation,without copying our source code in the customer's site I want to copy the executable files of the entire source codes? Is it possible in JSP,HTML&BEANS?

    In theory you can do it even with JSP but the you will be unable to run it on the standard JSP engine. :-)
    From other hand, all critical logic should be in the Java Beans or at least in custom tags but not in the JSP code. Then you can protect that code and leave JSP open because there is nothing to steal or break.

  • How to give path in plsql while exporting table data into .csv file

    hi,
    i have a code like this
    PROCEDURE dump_table_to_csv (
    p_tname IN VARCHAR2,
    p_dir IN VARCHAR2,
    p_filename IN VARCHAR2
    IS
    l_output UTL_FILE.file_type;
    l_thecursor INTEGER DEFAULT DBMS_SQL.open_cursor;
    l_columnvalue VARCHAR2 (4000);
    l_status INTEGER;
    l_query VARCHAR2 (1000) DEFAULT 'select * from ' || p_tname;
    l_colcnt NUMBER := 0;
    l_separator VARCHAR2 (1);
    l_desctbl DBMS_SQL.desc_tab;
    BEGIN
    l_output := UTL_FILE.fopen (p_dir, p_filename, 'w');
    EXECUTE IMMEDIATE 'alter session set nls_date_format=''dd-mon-yyyy hh24:mi:ss''';
    DBMS_SQL.parse (l_thecursor, l_query, DBMS_SQL.native);
    DBMS_SQL.describe_columns (l_thecursor, l_colcnt, l_desctbl);
    FOR i IN 1 .. l_colcnt
    LOOP
    UTL_FILE.put (l_output,
    l_separator || '"' || l_desctbl (i).col_name || '"'
    DBMS_SQL.define_column (l_thecursor, i, l_columnvalue, 4000);
    l_separator := ',';
    END LOOP;
    UTL_FILE.new_line (l_output);
    l_status := DBMS_SQL.EXECUTE (l_thecursor);
    WHILE (DBMS_SQL.fetch_rows (l_thecursor) > 0)
    LOOP
    l_separator := '';
    FOR i IN 1 .. l_colcnt
    LOOP
    DBMS_SQL.column_value (l_thecursor, i, l_columnvalue);
    UTL_FILE.put (l_output, l_separator || l_columnvalue);
    l_separator := ',';
    END LOOP;
    UTL_FILE.new_line (l_output);
    END LOOP;
    DBMS_SQL.close_cursor (l_thecursor);
    UTL_FILE.fclose (l_output);
    EXECUTE IMMEDIATE 'alter session set nls_date_format=''dd-MON-yy'' ';
    EXCEPTION
    WHEN OTHERS
    THEN
    EXECUTE IMMEDIATE 'alter session set nls_date_format=''dd-MON-yy'' ';
    RAISE;
    END;
    I am getting error like :-------
    SQL> exec dump_table_to_csv('deptair','c:/csv','aa.deptair');
    BEGIN dump_table_to_csv('deptair','c:/csv','aa.deptair'); END;
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 8
    ORA-29280: invalid directory path
    ORA-06512: at "SCOTT.DUMP_TABLE_TO_CSV", line 58
    ORA-06512: at line 1
    pplease help me out
    thanks
    vicky

    look at your other thread, answer is already there.

  • Count number of records in a internal table

    hi
    i want to count number of records in internal table
    pls let me know how to count the number of records in a internal table.
    regards
    Arora

    hi
    one way is
    data field type i.
    Decribe table itab lines field.
    write: / field.
    displays the no of records in tha internal table
    or if u want to write logic.
    data:
      w_count type i.
    loop at itab.
    w_count = w_count + 1.
    endloop.
    write: / w_count.
    displays the no of records.
    reward points if useful.

  • Missing records while downloading internal table to excel because of ' " '

    Friends...
    I am trying to download the contents of an internal table to an excel file.
    Now i tried to download the contents in debugging mode. I noticed there is this character " in one of the fields of my internal table, and i came to know, that presence of such special characters results in the internal table not getting exaclty downloaded to excel format.
    Is there any way to solve this problem. I thought of removing the field itself from the internal table but, thats not possible. Its mandatory to have that field in the table.
    Regards.

    Well.. by doing so.. the number of records etc is comin correctly, but the field in which the special character " is present, will be shown without " right.... so.. infact... the output is incorrect ....
    I am sorry, i cant share the file because of security reasons..

Maybe you are looking for