SAP Query Display data from 2 internal tables

Hi ABAP Gurus,
I am developing a SAP Query.
I have created an infoset with the custom infotype 9050 and added the table ZPA9050 into the Infoset.
How do I input values to the ZPA9050 fields? A checkbox for making a Selection field is not available in the Query (SQ01)
For every pa9050 entry there exist multiple records of ZPA9050. I need to display the pa9050 fields in the 1st row and the corresponding zpa9050 fields in the subsequent rows.
Kindly advise how to accomplish this task. 
A quick reply is highly appreciated.
Useful answers will be rewarded.
Thanks
Sriram

Hi Deepika,
   Your reqirement is to print data from the two internal tables ..and if u r not using interactive alv  then u need to merge data into single internal table... if anycase u dont want to merge in the table itab as u told u can use another final internal table in which u can merge data from the two previous interal tables then u pass this final internal table to ur FM.
Thanks & Regards
Ashu Singh

Similar Messages

  • How to display data from internal table in the SELECTION-SCREEN

    Hello Experts,
    My requirement is to display the data's from an internal table in the selection screen. I tried using selection-screen comment. But it is working only for a single record. Can anyone please tell me how to do this?

    Hi Ritika,
    we cant use write statement inside selection-screen.
    see my coding.
    SELECTION-SCREEN BEGIN OF SCREEN 123 AS WINDOW TITLE TEXT-456.
      SELECTION-SCREEN BEGIN OF BLOCK BL1 WITH FRAME TITLE TEXT-BL1
                                          NO INTERVALS.
        SELECT-OPTIONS SEL1 FOR SY-DATUM.
        PARAMETERS     PAR1(10).
    <b>** I WANT ALL RECORDS FROM AN INTERNAL TABLE HERE ONLY</b>
        SELECTION-SCREEN END OF BLOCK BL1.
      SELECTION-SCREEN PUSHBUTTON 2(10)  but1 USER-COMMAND cli1.
      SELECTION-SCREEN PUSHBUTTON 20(10)  but2 USER-COMMAND cli2.
    SELECTION-SCREEN END OF SCREEN 123.

  • Need some logic for displaying data from Internal Table

    Hi Guys,
                  I have a Internal Table with multiple entries.
    My ITAB looks like below.
    PN  VBELN  MATNR MATKX
    1     111       P-101    XXX
    2     121       P-102    XYZ
    2     112       P-103    ABC
    3     134       P-104    DEF
    3     124       P-105    EFG
    Now my requirement is I need to display the out put as follows through ALV or normal display.
    <Header>                                                  <Date>
                                                                      <Time>
    PN = 1
    VBELN   MATNR  MATKX
    111         P-101   XXX
    <Footer>
    Some gap (May be a line to differentiate)
    <Header >                                                <Date>
                                                                     <Time>
    PN = 2
    VBELN   MATNR  MATKX
    121         P-102   XYZ
    112         P-102   ABC
    <Footer>
    Some gap (May be a line to differentiate)
    <Header >                                                <Date>
                                                                     <Time>
    PN = 3
    VBELN   MATNR  MATKX
    134         P-104   DEF
    124         P-105   EFG
    <Footer>
    Thanks in Advance.
    Prasad.

    HI,
    Use:
    Data: W_PNlike PN.
    LOOP AT ITAB.
    If Itab-PN ne W_PN.
    <Header> <Date>
    <Time>
    PN = 1.
    VBELN MATNR MATKX   >>>>>>>>>>>>>>>First Line enter
    ELSE.
    VBELN MATNR MATKX  > line Next entry
    ENDIF.
    W_PN = ITAB-PN.
    AT-END PN.
    <Footer>
    ENDAT.
    ENDLOOP.
    Hope this resolve your issue.
    Regards,
    Gurpreet

  • How to send data from internal table to the shared folder in ABAP

    Hi experts,
             My requirement is to transfer data from a file to shared folder. i just did reading data from a file to a internal table. Now i want to send this internal table data into a shared folder which is  "
    xxx\y\z....".
    I do not have any idea on how to send data from internal table to the shared folder path.
    can anybody please help me out how to do this?
    Thanks & Regards
    Sireesha.

    Where that folder is located, its on presentation server i.e. desktop or application server.
    If its on presentation server, use FM GUI_UPLOAD.
    If its on application server, then use DATASET functions. Have a look at below link.
    [File Handling in ABAP|http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/frameset.htm]
    I hope it helps.
    Thanks,
    Vibha
    Please mark all the useful answers

  • Download data from internal table to flat file.

    I need to download the data from Internal table to Flat file. can any one suggest how to do it? i suppose WS_Download OR GUI_DOWNLOAD.
    but if it is please guide me how to use this.
    is thre any other F.M. please provide the information.
    Thanks in advance

    Hi,
    Try this,
    * File download, uses older techniques but achieves a perfectly
    * acceptable solution which also allows the user to append data to
    * an existing file.
      PARAMETERS: p_file like rlgrap-filename.
    * Internal table to store export data  
      DATA: begin of it_excelfile occurs 0,
       row(500) type c,
       end of it_excelfile.
      DATA: rc TYPE sy-ucomm,
            ld_answer TYPE c.
      CALL FUNCTION 'WS_QUERY'
           EXPORTING
                query    = 'FE'  "File Exist?
                filename = p_file
           IMPORTING
                return   = rc.
      IF rc NE 0.                       "If File alread exists
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
    *          TITLEBAR              = ' '
    *          DIAGNOSE_OBJECT       = ' '
               text_question         = 'File Already exists!!'
               text_button_1         = 'Replace'
    *          ICON_BUTTON_1         = ' '
               text_button_2         = 'New name'
    *          ICON_BUTTON_2         = ' '
    *          DEFAULT_BUTTON        = '1'
    *          DISPLAY_CANCEL_BUTTON = 'X'
    *          USERDEFINED_F1_HELP   = ' '
    *          START_COLUMN          = 25
    *          START_ROW             = 6
    *          POPUP_TYPE            =
          IMPORTING
               answer                = ld_answer
    *     TABLES
    *         PARAMETER              =
          EXCEPTIONS
              text_not_found         = 1
              OTHERS                 = 2.
    * Option 1: Overwrite
        IF ld_answer EQ '1'.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
    *            BIN_FILESIZE            =
                 filename                = p_file        "File Name
                 filetype                = 'ASC'
    *       IMPORTING
    *            FILELENGTH              =
            TABLES
                data_tab                = it_excelfile   "Data table
            EXCEPTIONS
                file_write_error        = 1
                no_batch                = 2
                gui_refuse_filetransfer = 3
                invalid_type            = 4
                OTHERS                  = 5.
          IF sy-subrc <> 0.
            MESSAGE i003(zp) WITH
                     'There was an error during Excel file creation'(200).
            exit. "Causes short dump if removed and excel document was open 
          ENDIF.
    * Option 2: New name.
        ELSEIF ld_answer EQ '2'.
          CALL FUNCTION 'DOWNLOAD'
            EXPORTING
                 filename            = p_file          "File name
                 filetype            = 'ASC'           "File type
    *             col_select          = 'X'            "COL_SELECT
    *             col_selectmask      = 'XXXXXXXXXXXXXXXXXXXXXXXXXX'
    *                                                   "COL_SELECTMASK
                 filetype_no_show    = 'X'     "Show file type selection?
    *       IMPORTING
    *             act_filename        = filename_dat
            TABLES
                 data_tab            = it_excelfile    "Data table
    *            fieldnames          =
            EXCEPTIONS
                 file_open_error     = 01
                 file_write_error    = 02
                 invalid_filesize    = 03
                 invalid_table_width = 04
                 invalid_type        = 05
                 no_batch            = 06
                 unknown_error       = 07.
        ENDIF.
      ELSE.                               "File does not alread exist.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
    *          BIN_FILESIZE            =
               filename                = p_file         "File name
               filetype                = 'ASC'          "File type
    *     IMPORTING
    *          FILELENGTH              =
          TABLES
               data_tab                = it_excelfile   "Data table
          EXCEPTIONS
               file_write_error        = 1
               no_batch                = 2
               gui_refuse_filetransfer = 3
               invalid_type            = 4
               OTHERS                  = 5.
        IF sy-subrc <> 0.
          MESSAGE i003(zp) WITH
                   'There was an error during Excel file creation'(200).
          exit. "Causes short dump if removed and excel document was open 
        ENDIF.
      ENDIF.
    Regards,
    Raghav

  • Extracting SAP Query,Infoset  Data from VB Application

    Hi,
    I need to get all SAP Queries,Infosets and SAP Query Group data from a VB application.
    I have found a Remote Enabled Function called    IQAPI_READ_QUERY_CATALOG.
    But when I call the Function from a VB application ,the call is not successful and even I am not getting any exception.
    The call is getting false with null exception .
    Can anyone please guide me.
    Or is there any other function module /procedure / table to extract SAP Query ,Infoset,SAP Query Group data??
    Thanks in Advance.

    http://stackoverflow.com/questions/3765373/how-do-i-do-a-select-distinct-using-a-sap-infoset-query

  • Display data from diferent tables

    My requirement is to display data from diferent tables supose tables likeVBAK and VBAP.it will allow for all entries concept oops abap?.
    how to write code for display data from diferent tables .
    method WDDOINIT.
    data:
    node_sflight type  ref to if_wd_context_node,
    Itab_sflight type standard table of SFLIGHT.
    select * from SFLIGHT into table Itab_sflight.
    node_sflight = wd_context->get_child_node( name = 'SFLIGHT_NODE' ).
    node_sflight->bind_table( itab_sflight ).
    endmethod.
    Thanks,
    Rama

    HI,
    IS IT CORRECT WAY OF DONIG CODING?
    IF I AM WORNG PLEASE SUGEST ME.
    method WDDOINIT.
    data:
    node_sflight type ref to if_wd_context_node,
    final type standard table of vbap.
    types: begin of t_vbak,
    vbeln type vbak-vbeln,
    end of t_vbak.
    endmethod.
    data wa_vbak type t_vbak.
    data i_vbak type standard table of t_vbak.
    types: begin of t_vbap,
    vbeln type vbap-vbeln,
    posnr type vbap-posnr,
    matnr type vbap-matnr,
    end of t_vbap.
    data wa_vbap type t_vbap.
    data i_vbap type standard table of t_vbap.
    select vbeln from vbak into table I_vbak.
    select vbeln posnr matnr from vbap into table I_vbap
    for all entries in I_vbak
    where vbeln = i_vbak-vbeln.
    loop at I_vbak.
    read table i_vbap with key vbeln = I_vbak-vbeln.
    final-vbeln = I_vbap-vbeln.
    final-posnr = I_vbap-posnr .
    final-matnr = I_vbap-matnr .
    append final.
    clear final.
    endloop.
    node_sflight = wd_context->get_child_node( name = 'NODE_VBAP' ).
    node_sflight->bind_table( final ).
    endmethod.
    Thanks,
    rama

  • Gui_download for transferring the data from internal table to excel sheet.

    hi all,
    i am using gui_download for transferring the data from internal table to excel sheet.
    I have a internal table with 3 columns col1,col2,col3 and I am getting the file at the specified path,but my problem is that,in the excel sheet(path specified) all the 3 columns values are printed in one column.Please help me.
    Thanks in advance.

    Hi Venkata,
    plz use FM 'SAP_CONVERT_TO_XLS_FORMAT' :
      call function 'SAP_CONVERT_TO_XLS_FORMAT'
        exporting
    *   I_FIELD_SEPERATOR          =
    *   I_LINE_HEADER              =
          i_filename                 = p_file
    *   I_APPL_KEEP                = ' '
        tables
          i_tab_sap_data             = t_mbew
    * CHANGING
    *   I_TAB_CONVERTED_DATA       =
    * EXCEPTIONS
    *   CONVERSION_FAILED          = 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.
    Hope this helps,
    Erwan

  • Downloading data from internal table to xls file leading zeros are not disp

    Hai abap gurus,
    when i am downloading data from internal table to excle file. some field values in a column are with leading zeros and some others dont have leading zeros.but in the output it is showing without leading zeros. then how to get with exact values.
    Ex:
    <b>ECC Code.</b>
    045234
      88567
    098456 
    but output is giving like this:
    45234
    88567
    98456
    how to get the actual values.....
    plz help me in this matter.

    Dear Kiran,
    Those field in the internal table having Leading Zeroes, make those fields' datatype as character.
    Then use the function module to download the content of the internal table to the excel file.
    Regards,
    Abir
    Don't forget to Reward Points  *

  • Convert data from internal table to XML file.

    Hi All,
    I am selecting data from database into one internal table.
    Now I want to convert data from internal table to xml file format and save in to my desktop. Please suggest me how I can achieve my requirement.
    Kindly reply me ASAP.

    Use this FM. SAP_CONVERT_TO_XML_FORMAT
    Check this link too -
    Re: Data Export in XML format
    XML files from ABAP programs

  • Reading Data from Internal Table

    Hi,
    Can anyone please tell me how to read data from Internal Tables in the Event Handler without using the Select statement OnInitialization?
    Thanks,
    Gaurav

    Hi Siddhartha,
    Can you tell me the problem in my code. I tried to work on the way you suggested. Though I have not finished with the coding, I just wanted to know whether I am going in the direction or not.
    I have declared the the structure in Type Defination as
    TYPES: BEGIN OF TEST_STRUC,
             BEGDA TYPE BEGDA,
             ENDDA TYPE ENDDA,
           END OF TEST_STRUC.
    TYPES: TEST_TAB_TYPE TYPE TABLE OF TEST_STRUC.
    In the Event Handler, I have added the following code on OnInputProcessing:
    event handler for checking and processing user input and
    for defining navigation
    DATA TEST_INFO LIKE LINE OF TEST_TAB.
    DATA: MYTAB6 TYPE TABLE OF PA0006,
          MYTAB6_WA LIKE LINE OF MYTAB6.
    REFRESH TEST_TAB.
    CLEAR TEST_INFO.
    MYTAB6_WA-BEGDA = REQUEST->GET_FORM_FIELD( STARTDATE ).
    MYTAB6_WA-ENDDA = REQUEST->GET_FORM_FIELD( ENDDATE ).
    IF EVENT->NAME EQ 'button'
       AND EVENT->SERVER_EVENT EQ 'click'.
      LOOP AT MYTAB6 INTO MYTAB6_WA.
        TEST_INFO-BEGDA = MYTAB6_WA-BEGDA.
        TEST_INFO-ENDDA = MYTAB6_WA-ENDDA.
      ENDLOOP.
      APPEND TEST_INFO TO TEST_TAB.
      CLEAR TEST_INFO.
      NAVIGATION->SET_PARAMETER( NAME = 'test_tab'
      VALUE = 'begda' ).
      NAVIGATION->SET_PARAMETER( NAME = 'test_tab'
      VALUE = 'endda' ).
      NAVIGATION->GOTO_PAGE( 'MyBSP2.htm').
    ENDIF.
    P.S. MyBSP2.htm is my next page.
    Thanks,
    Gaurav

  • Upload data from Internal table to text file with  '~' separator

    can anyone help me to download data from internal table to flat file with  ''  separator. GUI_DOWNLOAD is not working in my case ....like for ''  separator

    Here it is
    REPORT  zkb_test1.
    TYPE-POOLS: truxs.
    DATA: i_scarr TYPE TABLE OF scarr,
    i_conv_data TYPE truxs_t_text_data.
    SELECT * FROM scarr INTO TABLE i_scarr.
    CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
      EXPORTING
        i_field_seperator    = '~'
      TABLES
        i_tab_sap_data       = i_scarr
      CHANGING
        i_tab_converted_data = i_conv_data
      EXCEPTIONS
        conversion_failed    = 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.
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
        filename                = 'C:\Test1.txt'
        filetype                = 'ASC'
      CHANGING
        data_tab                = i_conv_data
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        not_supported_by_gui    = 22
        error_no_gui            = 23
        OTHERS                  = 24.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Regards
    Kathirvel

  • Hash lookup or Binary search to fetch data from internal table

    Hi All,
    I want to know Which is faster, Hash lookup or Binary search to fetch data from internal tables?
    Thanks,
    Mahesh
    Moderator Message: Duplicate post
    Edited by: kishan P on Oct 14, 2010 4:22 PM

    type mod* .the the sign would change to pattern.try and see.i checked.reward if works.

  • Mapping data from internal table to SAPSCRIPT Box.

    Hi Gurus,
    I have to create a sapscript where in I should get data from standard tables and display the data in box (table format) in sapscript. I know how to get a field (perform in zprogram) into sapscript form zprogram. I dont know how I can get data (internal table) from my zprogram into sapscript and display in a box.
    Your help is highly appreciated.

    Hi David,
        consider the below example say if your zprogram having the internal table table loop and you want to print the contents line by line or in a box,
    LOOP AT tj_1irg23d.
    header line
            CALL FUNCTION 'WRITE_FORM'
              EXPORTING
                element = 'ITEM_HEADER1'
              EXCEPTIONS
                OTHERS  = 1.
    endloop.
    then in your sap script main window or where ever you want to print just straight away give your internal table fileds as follows(just for example)
    I2           ,,&J_1IRG23D-ZEILE(Z)&,,&J_1IRG23D-MATNR&,,&J_1IRG23D-CHAPID&,,
    =           &J_1IRG23D-MENGE(Z)&,,&J_1IRG23D-MEINS&,,0.0,,
    then it will bring the values of your internal table in the form.

  • SMART FORMS- data from  internal table issue

    Hi ,
           I have a smart form in which I have to print three types of materials of Material Types say M1, M2 ,M3.
    In the SMART FORM,Main Window, I have created 3 TABLES for 3 types of Materials ie,
               TableM1,
               TableM2,
               TableM3.
    The internal tables to populate these TABLES are
    ( passing from Print program ).
                t_M1,
                t_M2,
                t_M3
    The Number of FIELDS vary in all the tables ,thats why I have created 3 internal tables for Diff Material Types.
    But only first TABLE is getting printed ie data inside TableM2, TableM3 are not getting printed.
    Can any SMARTFORM Gurus please let me know how I can solve this issue.
    Regards
    Avi

    Hi,
       Check whether you are mentioning any condition on the data. There are different possibilites of not getting printed. Like the way your displaying, data is in table.
    Can you please clearly mention how did you populated the internal table and kept the logic to print the values in the table. So that it problem would be  more clearly nown.
    Br,
    Laxmi

Maybe you are looking for

  • Looking to purchase a MacBook Pro - I could use some advice.

    Hello everyone, First, a little background on my current situation. I recently started a new job working at a high school as a techie. This school has just over a 2:1 ratio of Mac:PC. The college I attend, however, is a 90/10 PC-oriented organization

  • Game center muti account

    I have an apple id (obviously) and can set up game center on my iphone4. Both my kids have ipod touches and can't have apple id's as they are minors. Hence the three of us seem to have to share the same identity on game center. Is there a way around

  • IPOD causes "Blue Screen of Death" with physical memory dump

    Plugged in the IPOD into USB port on computer. It shows "found USB device" and then 5-10 seconds later I get the blue screen of death and a notification that there is a driver error and a physical memory dump as occurred. Spent two hours with Apple p

  • Passing xml as string to xmlPanel function

    hello Genius, I am using XML2UI feature of Extending Flash. I want to pass XML through string in place of xml file in xmlPanel function. is there any way to avoid creating 20 xml files and distributing them as my planned extension have 20 ui's. thank

  • Manual setting of date and time-..

    After finally getting my ATV3 updated to 6.2 via an iTunes restore with USB. I am now stuck at the activating screen with the sub note of setting date and time. I have reset and restored multiple times now. Reset my entire network. Disconnected cable