Issue In internal table data population in the o/p

Dear Guru , I have encountered an issue for which i am not able to findout the logic  . I have an internal table through which i am populating the below data for detail report format :->
Plant     Material Number          Storage Loc     Movement Type          Avg Days
019     0820B0073          MOD3          101               space
019     0820B0073          MOD3          101               space
019     0820B0073          MOD3          101               space
019     0820B0073          MOD3          101               space
019     0820B0073          MOD3          101               space
020     0820B0074          MOD4          101               space
020     0820B0074          MOD4          101               2
020     0820B0074          MOD4          101               3
The requirment is like this the summary report should show o/p like below addition of all the rows with respect to plant , material, storage location and movement type :-
Plant     Material Number          Storage Loc     Movement Type          Avg Days
019     0820B0073          MOD3          101               space
020     0820B0074          MOD4          101               5
but when i am adding it with respect to plant, material, storage location and movement type the o/p i am getting is like below
Plant     Material Number          Storage Loc     Movement Type          Avg Days
019     0820B0073          MOD3          101               0
020     0820B0074          MOD4          101               5
becasue addition of 5 spaces ( Avg Days )of plant 019 is coming as ZERO --> 0
so Guru what logic i should use to get the proper o/p,..I have Used Following logic to perform summation with respect to plant, material , storage loc and movement type.
CLEAR: wa_mkpf_mseg, w_werks, w_matnr, w_lgort, w_bwart.
LOOP AT t_mkpf_mseg INTO wa_mkpf_mseg.   
IF wa_mkpf_mseg-werks EQ w_werks AND wa_mkpf_mseg-matnr EQ w_matnr AND wa_mkpf_mseg-lgort EQ w_lgort AND wa_mkpf_mseg-bwart EQ w_bwart.
      CLEAR: wa_p_coi.
      READ TABLE t_p_coi INTO wa_p_coi WITH KEY werks = wa_mkpf_mseg-werks matnr = wa_mkpf_mseg-matnr lgort = wa_mkpf_mseg-lgort bwart = wa_mkpf_mseg-bwart.
     IF sy-subrc = 0.
     wa_p_coi-Avg Days    = wa_p_coi-Avg Days   + wa_mkpf_mseg-Avg Days.
     MODIFY t_p_coi FROM wa_p_coi TRANSPORTING Avg Days   .
     CLEAR: wa_p_coi, wa_p_coi.
     endif.
ELSE.
      wa_p_coi-werks                     = wa_mkpf_mseg-werks.
      wa_p_coi-matnr                     = wa_mkpf_mseg-matnr.
      wa_p_coi-bwart                   = wa_mkpf_mseg-bwart.
      wa_p_coi-lgort                     = wa_mkpf_mseg-lgort.
      wa_p_coi-Avg Days                  = wa_mkpf_mseg-Avg Days   .
     APPEND wa_p_coi TO t_p_coi.
           CLEAR: wa_p_coi.
ENDIF.
    w_werks = wa_mkpf_mseg-werks.
    w_matnr = wa_mkpf_mseg-matnr.
    w_lgort = wa_mkpf_mseg-lgort.
    w_bwart = wa_mkpf_mseg-bwart.
   CLEAR: wa_mkpf_mseg.
  ENDLOOP.

The soln what i found after working out
CLEAR: wa_mkpf_mseg, w_werks, w_matnr, w_lgort, w_bwart.
LOOP AT t_mkpf_mseg INTO wa_mkpf_mseg.
IF wa_mkpf_mseg-werks EQ w_werks AND wa_mkpf_mseg-matnr EQ w_matnr AND wa_mkpf_mseg-lgort EQ w_lgort AND wa_mkpf_mseg-bwart EQ w_bwart.
CLEAR: wa_p_coi.
READ TABLE t_p_coi INTO wa_p_coi WITH KEY werks = wa_mkpf_mseg-werks matnr = wa_mkpf_mseg-matnr lgort = wa_mkpf_mseg-lgort bwart = wa_mkpf_mseg-bwart.
IF sy-subrc = 0.
if wa_p_coi-Avg Days  = ' ' and wa_mkpf_mseg-Avg Days = ' '.
wa_p_coi-Avg Days = ' '.
ELSE
wa_p_coi-Avg Days = wa_p_coi-Avg Days + wa_mkpf_mseg-Avg Days.
Endif.
MODIFY t_p_coi FROM wa_p_coi TRANSPORTING Avg Days .
CLEAR: wa_p_coi, wa_p_coi.
endif.
ELSE.
wa_p_coi-werks = wa_mkpf_mseg-werks.
wa_p_coi-matnr = wa_mkpf_mseg-matnr.
wa_p_coi-bwart = wa_mkpf_mseg-bwart.
wa_p_coi-lgort = wa_mkpf_mseg-lgort.
wa_p_coi-Avg Days = wa_mkpf_mseg-Avg Days .
APPEND wa_p_coi TO t_p_coi.
CLEAR: wa_p_coi.
ENDIF.
w_werks = wa_mkpf_mseg-werks.
w_matnr = wa_mkpf_mseg-matnr.
w_lgort = wa_mkpf_mseg-lgort.
w_bwart = wa_mkpf_mseg-bwart.
CLEAR: wa_mkpf_mseg.
ENDLOOP.

Similar Messages

  • Adobe form - Split internal table data & dis on the right and left corner

    HI ,
    I have a form where i am populating the data via an Internal Table.
    The concern i have is i have 100 rows in the table and i want to print the first 10 rows on the right hand side of the page and the next 10 rows on the Left hand side of the page. I want to do this dynamically on multiple pages during run time based on the volume of data in the internal table.
    I am sure i cannot dynamically change the interface of the form to allow multiple internal table , Please suggest if there is any other solution.
    Thanks in advance
    Tk
    Edited by: tarunk on Jan 16, 2012 5:56 PM

    Hi,
    Thank you  very much for the input, But my concern is
    I have a table with 120 records.
    i have three columns which i have it on the right side as well as on the Left side of the page.
    EX:
    Right Side                                                                          Left Side
    Col1 col2 col3                                                                    col1 col2 col3.
    Now what i want to do is the first ten rows of the internal table data i want to print it on the Right Side and the Next 10 rows on the Left Side in the same page .
    I want to do this on Multiple pages.
    please suggest.
    Thanks,
    Tk

  • Internal table data 1E2 automatically convert to scientific format

    Dear all,
    I have been searched for solution moths from the forums and tried all possible methods, but still no way to solve my above problem.  I found a way to solve it partially for us, but may be very helpful for others who meet similly case like mine, so I posted here.
    my problem is when I export my internal table data to Excel, the Cell data with 1E2 auto becomes 1.00E02, and 1E8 becomes 1.00E08, we need it to be 1E2 and 1E8 in excel.
    you can recreate my problem by
    1,  input 1E2 into your Microsoft Excel, then Enter, it will auto change into scientific format. which is we do not want.
    2, use any of your SAP system open any table as long as there is a Char (>3) field in that table. add some
    data entry in that field in the form "any amount (<15) of numeric 1 to 9"E"any one or two numeric 1 to 9". such as, 123E2, 1234E12 etc. then save this table's data to local file spread sheet, or use any FM to download it to a Excel file, when you open this
    file by Excel, the cell with above form will display as scientific. but
    if you put three or more numeric after the "E", such as 123E123 it will
    display correctly.
    what I have done:
    I searched in SCN for similar thread:
        Export to Excel 2007 - item number problem
        Exceding the limit of numbers in Excel at target side
        Excel download cell format problem
        Formating as Text in excel through SAP
        Converting of amount field into excel file through GUI DOWNLOAD
        Data downloaded to excel gets converted to exponential format.
        Problem with Excel download   and scientific number
        Re: Issue in displaying numbers in Excel?
        CSV Flat File Data Problem (Number converting to Scientific Notation)
    Tested accordingly, But none of these works in our case. because our
    ultimate receiver of email attachment will be external third party, we cannot ask
    them to change anything in their Excel.
    Search Microsoft help about Excel, http://support.microsoft.com/kb/214233,
    and it says this "Automatic Number Formatting" is a normal behaviour of excel.
    no way to turn it off, the "work-around" way that Microsoft provides is not suitable for our
    case.
    We test CL_iXML recently arrording to weblog http://wiki.sdn.sap.com/wiki/display/Snippets/FormattedExcelasEmailAttachment
    it successful controled the format. so this could be a solution for others whose internal table size is small. but our 2MB internal table bocome 6MB when converted to xml file attachment, which cannot be received by our end user's mail box. too big.
    So please advise your ideas.
    Many thanks in advance!
    Peter Ding
    Thank you very much for your time!

    Hi,
    You can achieve this by describing the spreadsheet in XML with the help of the DOM classes.
    The later releases of Excel can read and save spreadsheets as XML, providing your release supports this you can achieve it.
    Check out the following Wiki
    [Excel - XML|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/exporting%2bdata%2bto%2bexcel%2b-%2bxml%2bto%2bthe%2brescue]
    Regards,
    Darren

  • Creation of internal table dynamically based on the Date Range entered

    Hi SAPgurus,
    I have been facing one issue i.e creation of internal table dynamically based on the date range entered in the selection screen. For example the date range I am giving as 06/2006 to 08/2006, it should display the Fieldcatelog dynamically, this part i have completed but the only issue I am facing is to populate the sales data into that fields.
    Right now my program is displaying the ALV like this.
    Ex:
    <b>CSR    District   06/2006  07/2006  08/2006  totals</b>      
    Shiva      New York                             10.00
    Shiva      new york                             30.00
    Shiva      new york                             40.00
    but it should display like this
    <b>CSR    District 06/2006 07/2006 08/2006 totals</b>
    Shiva  New York  10.00   30.00 40.00
    80.00                 
    Please help me in this scenario, how to acheive like this..
    Thanks & Regards,
    Sivaram Kandula

    Hi Sivaram,
                 I also got the same requirement . i saw rich and your code whatever you have uploaded.i have created dynamic internal table but i am facing the issue to populating the data to my dynamic internal table.
    Sivaram, can you please explain your code after this.
    *<dyn_table>
    *tab_item.
      LOOP AT tab_item.
        ASSIGN COMPONENT 1 OF STRUCTURE <dyn_wa> TO <dyn_table>.
        ASSIGN COMPONENT 2 OF STRUCTURE <dyn_wa> TO <dyn_table>.
    *    <dyn_wa> = tab_item-bztxt.
    *    <dyn_wa> = tab_item-total.
    *    APPEND <dyn_wa> TO <dyn_table>.
    **    <dyn_wa> = tab_item-total.
    **    ASSIGN tab_item-bezei  TO <dyn_wa>.
    *  APPEND <dyn_table>.
      ENDLOOP.
    how you are puting the loop at tab_item. but tab_item is already commented.
    can you send me the code after that.
    i am sending some part of my code.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
       EXPORTING
         it_fieldcatalog = gt_fCAT1
       IMPORTING
         ep_table        = new_table.
    ASSIGN new_table->* TO <dyn_table>.
       create data new_line like line of <dyn_table>.
       assign new_line->* to <dyn_wa>.
    select vbeln
            fkart
            vkorg
            vtweg
            fkdat
            spart
            fksto
            from vbrk
            client specified
            into table gt_vbrk
            where mandt = sy-mandt
            and fkart in ('ZF5','ZFR')
            and vkorg = '1100'
            and vtweg = '20'
            and fkdat in s_fkdat
            and spart = '06'
            and fksto = ' '.
       if gt_vbrk[] is not initial.
      select  vbeln
              fkimg
              prsdt
              netwr
              matnr
              arktx
              werks
              mwsbp
              from vbrp
              client specified
              into table gt_vbrp
              for all entries in gt_vbrk
              where vbeln = gt_vbrk-vbeln
              and werks in s_werks
              and matnr in s_matnr.
      endif.
    select mnr ltx spras from t247
    into table it_t247
    where spras = 'E'.
    data: lv_month1 type vbrp-prsdt,
           name1(3) type c,
           s_month type string,
            s_month1 type string,
             s_month2 type string.
    *      lv_netwr1 type vbrp-netwr,
    *          lv_mwsbp1 type vbrp-mwsbp.
          loop at gt_vbrp into gs_vbrp.
            gs_final2-matnr = gs_vbrp-matnr.
            gs_final2-arktx = gs_vbrp-arktx.
            gs_final2-fkimg = gs_vbrp-fkimg.
           lv_month1 = gs_vbrp-prsdt.
            read table it_t247 into wa_t247 with key mnr = lv_month1+4(2).
            if sy-subrc eq 0.
            name1 =  wa_t247-ltx.
            endif.
             concatenate  name1
                       lv_month1(4) into s_month SEPARATED BY '_' .
             CONCATENATE S_MONTH 'QTY' INTO S_MONTH1 SEPARATED BY ''.
              CONCATENATE S_MONTH 'VALUE' INTO S_MONTH2 SEPARATED BY ''.
             gs_final2-month = s_month.
              lv_netwr1 = gs_vbrp-netwr.
            lv_mwsbp1 = gs_vbrp-mwsbp.
            gs_final2-MONTH_QTY = S_MONTH1.
            GS_FINAL2-MONTH_VAL = S_MONTH2.
            gs_final2-value = lv_netwr1 + lv_mwsbp1.
           append gs_final2 to gt_final2.
           clear: gs_final2. "lv_name2.
           endloop.
           if gt_final2[] is not initial.
             sort gt_final2 by matnr month ascending .
             loop at gt_final2 into gs_final2.
            gs_final2_01 = gs_final2.
         collect gs_final2_01 into gt_final2_01.
        endloop.
           endif.
       ENDIF..
    Regards
    Ankur

  • Export & Import internal table data across the programs

    Hi All,
    I have two different reports,let say ZPRO1 & ZPRO2. I want to export internal table data of ZPRO1  to  ZPRO2 and then I want to do some calculations in ZPRO2 with the imported internal table data(ZPRO1).
    If I use 'SUBMIT' or CALL TRANSACTION syntax ZPRO1 is displaying..but I want to use only internal table data of ZPRO1.
    Pls advise.
    Pranitha.

    Hi,
      Please follow the simple code and try to solve your issue.
    Code in program1
    types: begin of ty_itab,
           matnr type matnr,
           end of ty_itab.
    data: it_itab type table of ty_itab,
          wa_itab type ty_itab,
          it_itab1 type table of ty_itab.
    select matnr from mara into table it_itab.
    export it_itab to shared buffer indx(st) id 'ABC'.
    Code in program2
    types: begin of ty_itab,
           matnr type matnr,
           end of ty_itab.
    data: it_itab type table of ty_itab,
          wa_itab type ty_itab.
    import it_itab from shared buffer indx(st) id 'ABC'.
    loop at it_itab into wa_itab.
    write:/ wa_itab-matnr.
    endloop.
      Please delete shared buffer indx(st) id 'ABC', once we don't need the internal table data.
    Regards
    Dande

  • How to pass the internal table data to smartforms

    Hi Gurus,
    I have a problem in passing the internal table data to the smartforms. In the print program
    I get the data into one internal table "LT_PRDLBL1". I am passing this internal table to the other in print program by calling the FM_NAME.
    CALL FUNCTION fm_name
      EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
        CONTROL_PARAMETERS         = T_SSFCTRLOP
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
        OUTPUT_OPTIONS             = T_SSFCOMPOP
        USER_SETTINGS              = ' '
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
      TABLES
        LT_PRDLBL                 = LT_PRDLBL1
    EXCEPTIONS
       FORMATTING_ERROR           = 1
       INTERNAL_ERROR             = 2
       SEND_ERROR                 = 3
       USER_CANCELED              = 4
       OTHERS                     = 5
    In the print program I had defined the internal tables like
    Data: lt_prdlbl  type standard table of zprdlbl.
    Data: Begin of lt_prdlbl1 occurs 0.
            include structure zprdlbl.
    Data: End of lt_prdlbl1.
    How do I define the internal table in the smartform to get the values printed in the smartform?.
    <REMOVED BY MODERATOR>
    Thanks,
    Edited by: Alvaro Tejada Galindo on Apr 21, 2008 1:01 PM

    Nehal,
    Thanks for quick response.
    In the smartform under the Form Interface->Tables tab
    I had defined
    LT_PRDLBL LIKE ZPRDLBL. If I define TYPE instead of LIKE I get the error message saying "FLAT TYPES may only be referenced using LIKE for table parameters".
    In the main window I have created LOOP, in which I have ticked the internal table and
    LT_PRDLBL INTO LT_PRDLBL. In the text node I am passing the values of this internal table
    &LT_PRDLBL-XXXX&.
    I am able to get the print but the data is not printing.
    Please help me with this.
    Thanks,

  • How to Pass the internal table data?

    DearAll,
    How to pass the Data of one internal table on a 1.html page to another html page for output, in BSP Application.
    regards.

    Hi ,
    In the onInputProcessing event of the first page , write the following code...
    call method NAVIGATION->SET_PARAMETER exporting
        name = 'it_filt_cur'
        value = it_filt_cur.
    Here it_filt_cur is internal table.
              NAVIGATION->GOTO_PAGE('next.htm').
    In the next page , you can make the internal table as auto in the attributes.
    Since you have made the itab as auto transfer , you can directly access the itab in the initialization event of the next page if it is stateless.
    Regards,
    Laxman Nayak.
    Message was edited by: Laxman  Nayak

  • FM to upload the Internal table data into application server.

    Hi,
      Could you please give me Function module to Upload the Internal table data into Application server ie., in Tcode AL11.
    I know for downloading the Application server file into itab is "SUBST_GET_FILE_LIST" FM and using open dtaa set we get the data.
    Regards,
    deepthi.

    Hi Deepthi
    Incase you are looking to upload data in the AL11 through a program , then you can make use of OPEN DATASET...CLOSE DATASET statements.
    Here's the code snippet:
    IF tb_alvdisplay[] IS INITIAL.
        MESSAGE e999(/dcsea/zais_msg) WITH text-e01.
      ELSE.
        IF  NOT cb_ufile IS INITIAL  "Download to file
         AND sy-pagno = 0.            "Only down page headers for first page
          PERFORM fm_concatenate_path_name USING    p_path
                                                    p_file
                                           CHANGING v_file.
    *Open file for download.
          PERFORM fm_open_file USING v_file .
        ENDIF.
        LOOP AT tb_alvdisplay.
          IF  NOT cb_ufile IS INITIAL.
    *Passing the values of the respective headings to the structure.
            ws_rec-vend_no     = tb_alvdisplay-vendno.
            ws_rec-vend_nm     = tb_alvdisplay-vendnm.
            ws_rec-title       = tb_alvdisplay-vendtl.
            ws_rec-add         = tb_alvdisplay-add.
            ws_rec-city1       = tb_alvdisplay-city1.
            ws_rec-region      = tb_alvdisplay-region.
            ws_rec-country     = tb_alvdisplay-country.
            ws_rec-pobox       = tb_alvdisplay-po.
            ws_rec-phone       = tb_alvdisplay-telf1.
            ws_rec-extn        = tb_alvdisplay-extn.
            ws_rec-fax         = tb_alvdisplay-telfx.
            ws_rec-zterm       = tb_alvdisplay-zterm.
            ws_rec-remark      = tb_alvdisplay-remark.
            ws_rec-email       = tb_alvdisplay-email.
    *Passing the separator 'PIPE' to the structure.
              ws_rec-sep01  = co_sep.
              ws_rec-sep02  = co_sep.
              ws_rec-sep03  = co_sep.
              ws_rec-sep04  = co_sep.
              ws_rec-sep05  = co_sep.
              ws_rec-sep06  = co_sep.
              ws_rec-sep07  = co_sep.
              ws_rec-sep08  = co_sep.
              ws_rec-sep09  = co_sep.
              ws_rec-sep10  = co_sep.
              ws_rec-sep11  = co_sep.
              ws_rec-sep12  = co_sep.
              ws_rec-sep13  = co_sep.
            TRANSFER ws_rec TO v_file.
          ENDIF.
          AT LAST.
            IF NOT cb_ufile IS INITIAL.
    *Closing the DATASET file.
              CLOSE DATASET v_file.
              IF sy-subrc <> 0.
    *Failure Message.
                MESSAGE e999(/dcsea/zais_msg) WITH text-t04 text-t06.
              ELSE.
    *Success message.
                MESSAGE s999(/dcsea/zais_msg) WITH text-t05.
              ENDIF.
            ENDIF.
          ENDAT.
        ENDLOOP.
      ENDIF.
    Also as Gautham suggested you can use tcode CG3Z or CG3Y incase you are looking to upload the data directly.
    FInally, you can search SCN using the keywords, "Upload to AL11" and you'll get loads of results.
    Hope this helps.
    Harsh

  • Internal table data issue

    i have a internal table i_final in program 1 and this internal table data need to be input of other program, so how i need to pass the i_final data to other program.

    this is the code in program 1:
      ENDIF.
    **appending work area to internal table.
        APPEND wa_final TO i_final.
      ENDLOOP.
      EXPORT i_final to memory id 'zfinal'.
    this is the code in program 2:
    TYPES: BEGIN OF t_final,
          bukrs TYPE bkpf-bukrs,
          belnr TYPE bkpf-belnr,
          blart TYPE bkpf-blart,
          xblnr TYPE bkpf-xblnr,
          ebeln TYPE ekbe-ebeln,
          ebelp TYPE ekbe-ebelp,
          belnr1 TYPE ekbe-belnr,
          xblnr1 TYPE ekbe-xblnr,
          ebeln1 TYPE ekko-ebeln,
          exnum TYPE ekko-exnum,
          lands TYPE ekko-lands,
          stceg_l TYPE ekko-stceg_l,
          END OF t_final.
    DATA: i_final TYPE STANDARD TABLE OF t_final WITH HEADER LINE.
    DATA: wa_final TYPE t_final.
    IMPORT i_final from memory ID 'zfinal'.
    write: i_final.
    its giving Dump.

  • 2 different  tables   in the main window with same internal table data

    Hi All,
    can we have 2 diffterent  tables with same internal table data into its work area in the main window.Is it possible or we will get any run time error.?
    is it like having 2 nested loop with same internal table ?
    ex : loop at itab1 into wa_itab.
           loop at itab1 into wa_itab.
    endloop.
    endloop.
    can we use like this?

    Hi,
    there will not be any error ...but what is the use of it...
    do you need to have a controlled way of display ...of the data...
    If so then you create another workarea in the global definitions of the same type and then use it...
    Regards,
    Ram

  • Problem with Emailing the Internal table data as an excel attachment

    Hi Friends,
    I am facing problem with Emailing an internal table data as an excel file. I am using standard function module "SO_NEW_DOCUMENT_ATT_SEND_API1" which is using SOLI structure can have record with 255 character length. But my Internal table having each record means after concatenating all the fields it is going to be morethan 450 characters. so i t is not displaying all the data in excel file.
    Can somebody help me if there is any other function module or any other way that i need to follow.
    thanks for help
    venkat.

    You must use the the :
    CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB as a field seperator and
    CL_ABAP_CHAR_UTILITIES=>CR_LF as a record seperator.
    Check this example:
    http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm
    Regards,
    Naimesh Patel

  • PDF File from an internal table data

    I have an internal table ready for grid display of a report. But according to the new requirement, it shouldn't create a Spool request as it is affecting the performance of the system (because its a huge file with 3000+ pages).
    So, now we want to create a (non-editable) PDF File and store it in an application server.
    From the forum, i see that i have only one option, which is to Convert internal table data to OTF Format and then to PDF.
    Right now i am using  PRINT_TEXT to convert to OTF file and FM CONVERT_OTF for PDF file.
    The challenges i am facing right now is..
    1. After getting the OTF file from PRINT_TEXT, i couldn't get the correct PDF File. It shows random characters instead..
    2. My internal table has 103 columns. So how should i accommodate data from all these columns into a single row on a PDF?
    3. I couldn't create a table kind of view/display in PDF
    Please help/advice me on the above issue.
    Thanks,
    Sarada

    Hi,
    103 columns need to be seen in at least 7 pages or more. Cant display in just 1 page.
    I guess that better to create a smartforms and pass all the information from the table to the smartforms.
    There you can create multipages.
    Probably, that huge table need to separete it in 7 tables, so each page will get the information from one table...
    i will try to do sth like that.
    Regards
    Miguel

  • Issue regarding internal tables

    Dear all,
    My issue is that , I need to enter data into a single internal table by fetching data from two sap tables using two different selct quries. I should not use joins or for all entries. And display the internal table data in the list.
    Problem am facing is only one select query is geeting fetched and the other table data in not in the list.
    Pleas provide the possible solutions.
    Thanks & Regards,
    Madhavi.M

    DATA: BEGIN OF itab1 OCCURS 0,
          qmnum LIKE qmel-qmnum,
          qmtxt LIKE qmel-qmtxt,
          indtx LIKE qmel-indtx,
          qmdat LIKE qmel-qmdat,
          ltrmn LIKE qmel-ltrmn,
          priok LIKE qmel-priok,
          aufnr LIKE qmel-aufnr,
          bezdt LIKE qmel-bezdt,
          qmnam LIKE qmel-qmnam,
          qmart LIKE qmel-qmart,
          END OF itab1.
    DATA: BEGIN OF itab2 OCCURS 0,
          qmnum LIKE qmih-qmnum,
          btpln LIKE qmih-btpln,
          ingrp LIKE qmih-ingrp,
          END OF itab2.
    DATA : itab3 TYPE TABLE OF z_notif WITH HEADER LINE.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    SELECT-OPTIONS : notnum FOR qmel-qmnum OBLIGATORY,
                     notype FOR qmel-qmart,
                     floc FOR qmih-btpln,
                     name FOR qmel-qmnam.
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
    To fetch the values in the internal table ****************
    from ztable corresponding to the entries made *************
    by the user in the selection screen ******************
    SELECT qmnum qmtxt indtx qmdat ltrmn priok aufnr bezdt qmnam qmart INTO
    TABLE itab1 FROM qmel WHERE qmnum IN notnum
    AND qmart IN notype AND qmnam IN name.
    SELECT qmnum btpln ingrp INTO TABLE itab2 FROM qmih FOR ALL ENTRIES IN
    itab1 WHERE qmnum = itab1-qmnum AND btpln IN floc.
    To move the contents of ITAB1 to ITAB3 ***************
        LOOP AT itab1.
          itab3-qmnum = itab1-qmnum.
          itab3-qmtxt = itab1-qmtxt.
          itab3-indtx = itab1-indtx.
          itab3-qmdat = itab1-qmdat.
          itab3-ltrmn = itab1-ltrmn.
          itab3-priok = itab1-priok.
          itab3-aufnr = itab1-aufnr.
          itab3-bezdt = itab1-bezdt.
          itab3-qmnam = itab1-qmnam.
          itab3-qmart = itab1-qmart.
          READ TABLE itab2 WITH KEY qmnum = itab1-qmnum.
    To move the contents of ITAB2 to ITAB3 ***************
          itab3-btpln = itab2-btpln.
          itab3-ingrp = itab2-ingrp.
          APPEND itab3.
        ENDLOOP.
    have a look at this example this may help you.....
    reward if helpful.....

  • Dynamic Internal table data

    Hi All,
    I was created program to generate Dynamic field catalog and internal table, here is confusion how to display below mentioned internal table data to final dynamic internal table based on document type headings
    This is Statsic internal table Data
    1 0000123  GBP  DA  S  6265.45
    2 0000123  GBP  DA  H  240.51
    3 0000123  GBP  DA  S  35.82
    4 0000123  GBP  D1  H  281.85
    5 0000123  GBP  D1  S  23.41
    6 0000123  GBP  D1  S  34.23
    7 0000123  GBP  RV  H  97.02
    8 0000123  GBP  RV  S  52.90
    9 0000123  GBP  RV  S  148.31
    Can anybody suggest me how to populate the amount based on Document type and posting (credit or debit)
    For Example
    CUST DAC       DAD         D1C       D1D     RVC     RVD
    123                  6265.45   240.51
                            35.82
    Thanks in Advance
    Sekhar
    Moderator message: please do not open multiple threads for the same or similar issue.
    Edited by: Thomas Zloch on Dec 9, 2011 4:17 PM

    Hi All,
    I was created program to generate Dynamic field catalog and internal table, here is confusion how to display below mentioned internal table data to final dynamic internal table based on document type headings
    This is Statsic internal table Data
    1 0000123  GBP  DA  S  6265.45
    2 0000123  GBP  DA  H  240.51
    3 0000123  GBP  DA  S  35.82
    4 0000123  GBP  D1  H  281.85
    5 0000123  GBP  D1  S  23.41
    6 0000123  GBP  D1  S  34.23
    7 0000123  GBP  RV  H  97.02
    8 0000123  GBP  RV  S  52.90
    9 0000123  GBP  RV  S  148.31
    Can anybody suggest me how to populate the amount based on Document type and posting (credit or debit)
    For Example
    CUST DAC       DAD         D1C       D1D     RVC     RVD
    123                  6265.45   240.51
                            35.82
    Thanks in Advance
    Sekhar
    Moderator message: please do not open multiple threads for the same or similar issue.
    Edited by: Thomas Zloch on Dec 9, 2011 4:17 PM

  • Start routine internal table data  is inaccessible.

    Hi Guru,
    I have written a small code in start routine  using internal tables. The internal table has 4 fields. Intially first 3 fields are populated from ods for only the records in the data package. Then the 4th field is modified using loop on internal table. Then a sort is done on internal table  and deleting the adjacent records. Now the data is read from internal table in updates rules. But data is not populating for the fields in listcube. I guess the loop on internal table is not modifying the internal table, below is the code.
    Types: BEGIN OF ITAB1,
    doc_no LIKE /BIC/AZFGLO10100-AC_DOC_NO,
    item_no LIKE /BIC/AZFGLO10100-ITEM_NUM,
    taxjur LIKE /BIC/AZFGLO10100-TAXJURCODE,
    z_len TYPE I,
    END OF ITAB1.
    DATA ITAB_01 TYPE TABLE OF ITAB1 WITH HEADER LINE.
    DATA LEN TYPE I.
    DATA: str1 TYPE string,
    str2 TYPE string,
    doc like /BIC/AZFGLO10100-AC_DOC_NO,
    item like /BIC/AZFGLO10100-ITEM_NUM,
    jur like /BIC/AZFGLO10100-TAXJURCODE.
    ***filling the internal table with the contents of
    select AC_DOC_NO ITEM_NUM TAXJURCODE into
    corresponding fields of itab_01
    from /BIC/AZFGLO10100
    FOR ALL ENTRIES IN DATA_PACKAGE
    WHERE AC_DOC_NO = DATA_PACKAGE-AC_DOC_NO
    AND ITEM_NUM = DATA_PACKAGE-ITEM_NUM.
    endselect.
    SORT ITAB_01 ASCENDING BY doc_no ITEM_NO ASCENDING.
    loop at itab_01.
    doc = itab_01-doc_no.
    item = itab_01-item_no.
    TAX = itab_01-taxjur.
    len = STRLEN(tax).
    itab_01-z_len = len.
    modify itab_01 transporting z_len where
    doc_no = doc and item_no = item.
    ENDLOOP.
    ***what I am doing here I am keep only the records in itab which has minimum
    tax jurisdiction length for a line item in a document*****
    SORT ITAB_01 DESCENDING BY doc_no z_len ASCENDING.
    DELETE ADJACENT DUPLICATES FROM itab_01 comparing doc_no.
    and for zlenght object I am writing the followoing code in update rules.
    read table itab_01 with key doc_no = COMM_STRUCTURE-AC_DOC_NO
    BINARY SEARCH.
    if sy-subrc = 0.
    RESULT = itab_01-z_len.
    endif.
    But the field z_len field is blank for all fields.
    Any help is really appreciated.
    Thanks,
    Raj

    hi Ravi,
    try to give same field name in internal table and /BIC/AZFGLO10100, change the code accordingly
    Types: BEGIN OF ITAB1,
    <b>AC_DOC_NO</b> LIKE /BIC/AZFGLO10100-AC_DOC_NO,
    <b>ITEM_NUM</b> LIKE /BIC/AZFGLO10100-ITEM_NUM,
    <b>TAXJURCODE</b> LIKE /BIC/AZFGLO10100-TAXJURCODE,
    z_len TYPE I,
    END OF ITAB1.
    DATA ITAB_01 TYPE TABLE OF ITAB1 WITH HEADER LINE.
    ***filling the internal table with the contents of
    select AC_DOC_NO ITEM_NUM TAXJURCODE into
    <b>corresponding fields</b> of itab_01
    from /BIC/AZFGLO10100
    FOR ALL ENTRIES IN DATA_PACKAGE
    WHERE AC_DOC_NO = DATA_PACKAGE-AC_DOC_NO
    AND ITEM_NUM = DATA_PACKAGE-ITEM_NUM.
    endselect.
    <b></b><b></b>

Maybe you are looking for

  • Enhancement to s_alr_87012178

    Dear Friends, Before post the thread i browse alot for the solution but i didn't get any relavant solution. I need to enhancce customer name in customer ageing report(s_alr_87012178). for this in the selection screen -> output contorl ->           we

  • How do I get rid of IMatch and ICloud and go back to manual syncing?

    I often find myself with little or no service living in a rural town or working outside and this always having to download a song every time I want to hear it is a pain in the @$$. I just want to go back to the ways of the 3GS and have to Sync up son

  • White horizontal line on macbook pro retina display

    When I scroll through photos, sometimes a white horizontal line will span the screen for a short time. It will span the whole screen for less than a fraction of a second so it was difficult to take a photo of it. I managed to do it but here the line

  • Mapping issue: Split a string to multiple strings in an idoc

    Hi, I need to split a string with an undefined length into strings of 132 chars. The problem is, how to map from the source field to the target field, which belong to an idoc segment. The segment has the occurence 1 to unbounded, and the field 0 to 1

  • IDOC to CIDX

    Dear All, I am trying to develop interface using SAP PI within my company to other company. My Company will use idoc. The other company is using CIDX adapter. This will be b2b scenario. 1. Should I create two party? first party is sap r3, second part