Intenal table logic

Hi Friends,
I need a logic for the below mentioned thing,
for all entries in i_tab i need to check makt table with makt-matnr = i_tab-matnr.
if subrc = 0.
need to determine eknam
    Join tables marc and t024 . fill the i_tab-eknam field with the value T024-eknam where MARC-MATNR = I_TAB-MATNR and  MARC-WERKS = '0001' and MARC-EKGRP = TO24-EKGRP
endif.      
Thanks in advance

data: records type i.
records = lines( i_tab ).
Check records GT 0.
Select matnr from makt into i_makt for all entries in i_tab where matnr = i_tab-matnr.
Check sy-subrc EQ 0.
Select amatnr beknam into i_t024
from marc as A inner join t024 as B ON aekgrp = bekgrp
for all entries in i_makt
where a~matnr = i_makt-matnr
and a~werks = 0001.
Check sy-subrc EQ 0.
field-symbols: <fs_tab> type any.
Loop at i_tab assigninig <fs_tab>.
Read table i_t024 with key matnr = <fs_tab>-matnr binary search.
if sy-subrc eq 0.
<fs-tab>-eknam = i_t024-eknam.
endif.
Endloop.

Similar Messages

  • Intenal tables

    Hi Guys,
                  I am having two internal tables.I have to mov the data from one Internal table to another internale table.I have to transfer the second internal table data into a file
    It_bkpf------all columns.
    DATA: BEGIN OF wa_bkpf_temp,
            lineno(7) TYPE n,
            prog_space     TYPE c VALUE ' ',
            data_rec(712) TYPE c ,
         END OF wa_bkpf_temp.
               I wrote the logic like this
      LOOP AT il_bkpf_header into wa_bkpf_header_out. "Load data to SAP Server.
        got_cha_cnt = got_cha_cnt + 1.
        MOVE got_cha_cnt TO wa_bkpf_temp-lineno.
       MOVE wa_bkpf_header_out TO wa_bkpf_temp-data_rec.-----Syntax Error
        TRANSFER wa_bseg_temp TO wa_acntdoc_header_file.
      ENDLOOP.
                       I wrote the abap Statement like this
        MOVE wa_bkpf_header_out TO wa_bkpf_temp-data_rec.
          But i am getting syntax error.can anybody tell me how to move the data from BKPF intenal table to wa_bkpf_temp.
                    Very urgent.
    Thanks,
    Gopi.

    Below  is the code for  capturing data fromt he table to internal table then to  FILE.
    just copy the code and try  .... and change the table  which ever you wasnt and fields also...
    REPORT  ZREPORT_CAPTURE  no standard page heading.
    TABLES:     ekko.
    TYPE-POOLS: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout    TYPE slis_layout_alv,
          gd_repid     LIKE sy-repid.
    DATA: BEGIN OF it_report OCCURS 0,
          line(300),
          END OF it_report.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    * retrieve data
      PERFORM data_retrieval.
    *END-OF-SELECTION.
    END-OF-SELECTION.
    * display date on screen
      write: sy-uline(27).
      LOOP AT it_ekko INTO wa_ekko.
        WRITE:/ sy-vline,
                (10)wa_ekko-ebeln, sy-vline,
                (10)wa_ekko-ebelp, sy-vline.
      ENDLOOP.
      write:/ sy-uline(27).
    * capture report to internal table, does not work for ALV reports
      CALL FUNCTION 'LIST_TO_ASCI'
        EXPORTING
          LIST_INDEX               = 0
        TABLES
          listasci                 = it_report.
    * download report to file
      CALL FUNCTION 'WS_DOWNLOAD'
        EXPORTING
          filename = 'C:tempreport.txt'
          filetype = 'ASC'
        TABLES
          data_tab = it_report.
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
       UP TO 10 ROWS
        FROM ekpo
        INTO TABLE it_ekko.
    ENDFORM.                    " DATA_RETRIEVAL
    Reward  Poitns if it is  usefull ...
    Girish

  • Inserting records into Table with check table logic in place

    I want to insert records into a table, and have the check table to not allow invalid entries.  Is there a function out there that will allow this?  I am currently using the insert statement and it is working except that it is not giving an error when the value does not exist in the check table for the particular fields.
    INSERT INTO ZSD_XREF VALUES WA_XREF.
    That is the basic statement I'm using ZSD_XREF has several fields one being the material number field tied to the check table which happens to be MAKT file.  The insert statement is not validating the material numbers using the check table, or at least it is not giving an error.  Any ideas?

    Paul,
    Unfortunately, open SQL statements such as INSERT, UPDATE do not go through the check table logic as they directly hit the database layer. Check table checks are performed only if you go through application layer that is when you enter the same data through a screen.
    You have to do the checks yourself.
    Happy checking!!!
    Srinivas

  • Whar are logical table, Physical table Logical data Source

    Hi,
    Can any one explain me in details what Whar are logical table, Physical table Logical data Source.
    Any qucik help will be graetly appreciated

    In OBI there are three layers - Physical, Business Model and Mapping (BMM) and Presentation.
    As the name specifies the Physical layer mainly contain physical aspect of the application like which connection to use, which schema (also catalog in case of SQL server) to connect and also which table to use. This layer confirms the PK_FK joins for the related tables. This layer mainly depicts how the data has been stored in the database layer.
    On top of this layer you will have you BMM layer. The place where all work of a developer starts. You will structure the tables accourding to the business need. The structure has to be a STAR schema. All the entities in this layer are called logical because they do not directly represent any database object rather they provides a logical mapping to the database entities. This becomes clear when you use more that one Logical Table Source (LTS) for your logical tables. One logical column can map to N number of physical columns based on context. You can also create calculative columns in this layer which are totaly logical in nature.
    I am not writing anything on Presentation layer as it is not in you question. :)
    Hope this will help.
    Regards,
    Somnath

  • VA03 - Base tables & Logic  for structures

    Hi,
    In a data archiving project, I have to identify the tables & fields which are to be archived based on customers reports. When we try to find out tables & fields for the reports, there are lot of fields with structures. How to find out the base tables for these structures? In VA03 report, I need to find out the base tables & logic for the below structure-fields
    CCDATA-CCINS
    CCDATA-CCNUM
    RV45A-DWERK
    RV45A-BTGEW
    RV45A-GEWEI
    RV45A-VOLUM
    RV45A-VOLEH
    CCDATA-DATBI
    VBAPD-EPMEH
    RV45A-PRGBZ
    KOMV-KSCHL
    KOMV-KBETR
    RV45A-KOEIN
    RV45A-KFREL
    RV45A-ABGESP
    RV45A-DWERK
    VBAPD-EPMEH
    RV45A-PRGBZ
    RV45A-KFREL
    RV45A-KWMENG
    RV45A-PRGBZ
    RV45A-ETDAT
    RV45A-EPMEH
    RV45A-KFREL
    RV45A-PSTYP
    RV45A-KNTTP
    VBEPD-RSETD
    VBAPD-EPMEH
    RV45A-GRETD
    Could you please tell me the base tables & the logic for these fields.
    Thanks,
    Venkat

    Hi
    Venkat Rao
    Just check the field in the tables given by  Jhon and also check the some of the tables below
    VEPVG - Open Sals Order QTY.
    VBUK - Open Sales Order
    Use the transaction SE16  / SE11 and try to serach the field and find out base tables and logic.
    RV45A-DWERK ---   Plant u will find this in VBAP
    RV45A-PSTYP  ---  Document type and so on.....
    Thx.

  • Internal table logic issue

    Hi All,
    I have one logical issue related to internal table manipulation.
    I have one internal table :
    I_DAT - This is related to Loading/Unloading of Goods.
    for example with 3 fields
    VSTEL, KUNNA, KMMANG.
    Now suppose my data looks like this after sorting:
    VSTEL   KUNNA    KMMANG
    100       -        -
    200       -        -
    300       -        -
    400       -        -
    -         500      X
    -         600      X
    -         700      X
    -         800      X
    Here 100,200,300,400 are Loading points.
    ANd 500,600,700,800 are unloading points.
    Now what i want is For loading & Unloading points i need to pick up Address and print one after other.
    But how they need to print is:
    FOR INITIAL LOADING OF
    ADDRESS- For 100
    FIRST STOP: FOR LOADING OF
    ADDRESS- For 200
    SECOND STOP: FOR LOADING OF
    ADDRESS- For 300
    Etc .....
    Then
    FOR UNLOADING OF:
    ADDRESS- For 400
    FIRST STOP: FOR UNLOADING OF
    etc.
    FINAL STOP: FOR FINAL UNLOADING OF
    We might get as many records :
    Can any body give me the logic:
    Printing Address is not a problem:
    But Above every address we need to print FIRST STOP, SECOND etc like that.
    For this i need logic.
    Can anybody give the solution!
    Thanks in advance.
    Thanks & Regards,
    Prasad.

    Try this.I think you want output like this......
    DATA: BEGIN OF LINE,
            CARRID   TYPE SBOOK-CARRID,
            CONNID   TYPE SBOOK-CONNID,
            FLDATE   TYPE SBOOK-FLDATE,
            CUSTTYPE TYPE SBOOK-CUSTTYPE,
            CLASS    TYPE SBOOK-CLASS,
            BOOKID   TYPE SBOOK-BOOKID,
          END OF LINE.
    DATA ITAB LIKE SORTED TABLE OF LINE WITH UNIQUE KEY TABLE LINE.
    SELECT CARRID CONNID FLDATE CUSTTYPE CLASS BOOKID
           FROM SBOOK INTO CORRESPONDING FIELDS OF TABLE ITAB.
    LOOP AT ITAB INTO LINE.
      AT FIRST.
        WRITE / 'List of Bookings'.
        ULINE.
      ENDAT.
        AT NEW CARRID.
          WRITE: / 'Carrid:', LINE-CARRID.
        ENDAT.
          AT NEW CONNID.
            WRITE: / 'Connid:', LINE-CONNID.
          ENDAT.
            AT NEW FLDATE.
              WRITE: / 'Fldate:', LINE-FLDATE.
            ENDAT.
              AT NEW CUSTTYPE.
                WRITE: / 'Custtype:', LINE-CUSTTYPE.
              ENDAT.
                   WRITE: / LINE-BOOKID, LINE-CLASS.
                AT END OF CLASS.
                  ULINE.
                ENDAT.
    ENDLOOP.
    This is also helpful......
    LOOP AT <itab>.
      AT FIRST. ... ENDAT.
        AT NEW <f1>. ...... ENDAT.
          AT NEW <f2 >. ...... ENDAT.
              <single line processing>
          AT END OF <f2>. ... ENDAT.
        AT END OF <f1>. ... ENDAT.
      AT LAST. .... ENDAT.
    ENDLOOP.
    Regards
    Abhishek

  • Reg. internal table logic

    Hi,
    I have an internal table with 5 fields (Vbeln, A, B, C, D ) and records like this:
    Record1:
    Field vbeln (value is  6000000001), Field A (value is 2006), Field B (value is 1130), Field C (value is initial), Field D (value is initial)
    Record1:
    Field vbeln (value is  6000000001), Field A (value is initial), Field B (value is initial), Field C (value is 2005), Field D (value is 1134)
    Now whenever, Field A and Field B has values, field C and field D are initial and vice versa.
    I Want to get all of the field values in just one record like below when the key vbeln is same.:
    Field vbeln (value is  6000000001), Field A (value is 2006), Field B (value is 1130), Field C (value is 2005), Field D (value is 1134)
    I know I can create another internal table, copy the contents, use the looping logic and achieve the same but wondering if there is any better way of doing the same?
    Appreciate your input.
    Thanks!

    Hi,
    You need another internal tables. Please try this.
    SORT ITAB1.
    ITAB2[] = ITAB1[].
    LOOP AT ITAB1.
      LOOP AT ITAB2 WHERE ITAB2-VBELN EQ ITAB1-VBELN
                      AND ITAB2-DATE1 NE ITAB1-DATE1
                      AND ITAB2-TIME1 NE ITAB1-TIME1.
        ITAB3-VBELN = ITAB1-VBELN.
        ITAB3-DATE1 = ITAB1-DATE1.
        ITAB3-TIME1 = ITAB1-TIME1.
        ITAB3-DATE2 = ITAB2-DATE2.
        ITAB3-TIME2 = ITAB2-TIME2.
        APPEND ITAB3.
      ENDLOOP.
    ENDLOOP.
    Regards,
    Ferry Lianto

  • Regarding Internal table logic

    Hi,
    I have my internal table as follows:
    DATA: BEGIN OF I_DATA OCCURS 0,
            prgname TYPE SYST-REPID,
            matnr   TYPE mara-matnr,
            berid   TYPE mdma-berid,
          END OF I_DATA.
    Data that fills into can be as follows:
    Ex:
    PROGRAM1,1000,MRP1
    PROGRAM1,1000,MRP1
    PROGRAM1,2000,MRP1
    PROGRAM2,1000,MRP1
    PROGRAM2,1000,MRP1
    PROGRAM2,2000,MRP1
    PROGRAM3,1000,MRP1
    PROGRAM3,1000,MRP1
    PROGRAM3,2000,MRP1
    It can any order in above way.
    Then i will sort the above data as follows:
    SORT I_DATA BY prgname matnr berid.
    Now here my issue is:
    DATA: t_objtxt     LIKE solisti1   OCCURS 0  WITH HEADER LINE.
    I need to push the above internal table data into T_OBJTXT internal table as follows:
    It should first Display program Name as Program Name: Program3, Then column heading MATNR, BERID below it and data of that program[1st] below them till all the 1st program's data finished. Whenever MATNR value changes in this program list i need to print an ***** like line. TO indicate all the materials printed.
    When 2nd program comes again i have to write Program Name: Program2, Then column heading MATNR, BERID below it and data of that program[1st] below them till all the 1st program's data finished. Whenever MATNR value changes in this program list i need to print an ***** like line. TO indicate all the materials printed.
    When 3nd program comes again i have to write Program Name: Program3, Then column heading MATNR, BERID below it and data of that program[1st] below them till all the 1st program's data finished. Whenever MATNR value changes in this program list i need to print an ***** like line. TO indicate all the materials printed.
    Etc. Same process we need to follow.
    The final out put should be as below:
    PROGRAM NAME : PROGRAM1
    MATNR, BERID
    1000,MRP!
    1000,MRP1
    2000,MRP1
    PROGRAM NAME : PROGRAM2
    MATNR, BERID
    1000,MRP!
    1000,MRP1
    2000,MRP1
    PROGRAM NAME : PROGRAM3
    MATNR, BERID
    1000,MRP!
    1000,MRP1
    2000,MRP1
    Like wise o/p need to be send to I_OBJTXT and to email.
    <b>The logic i have written is as follows:</b>
      LOOP AT I__DATA.
        AT NEW PRGNAME.
          MOVE '*****************************************' TO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
          CONCATENATE t_objtxt-line 'PROGRAM NAME : '
                      I_DATA-PRGNAME
                      INTO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
          MOVE '*****************************************' TO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
          CONCATENATE TEXT-024 " Material
                      TEXT-025              " MRP
                      INTO t_objtxt-line
                      SEPARATED BY C_COMMA.
          APPEND t_objtxt.
          CLEAR t_objtxt.
          MOVE '-----------------------------------------' TO t_objtxt-line.
          CONCATENATE t_objtxt-line '------------------' INTO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
        ENDAT.
    *    MOVE '' TO t_objtxt-line.
    *    APPEND t_objtxt.
    *    CLEAR t_objtxt.
        CONCATENATE I_DATA-MATNR
                    I_DATA-BERID
                    INTO t_objtxt-line
                    SEPARATED BY C_COMMA.
        APPEND t_objtxt.
        CLEAR t_objtxt.
        AT END OF MATNR.
          MOVE '' TO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
          MOVE '*****************************************' TO t_objtxt-line.
          CONCATENATE t_objtxt-line '******************' INTO t_objtxt-line.
          CONCATENATE t_objtxt-line '******************' INTO t_objtxt-line.
          APPEND t_objtxt.
          CLEAR t_objtxt.
        ENDAT.
      ENDLOOP.
    The above logic is not working correctly.
    Can anybody give me correct logic for the same.
    Thanks in advance.
    Thanks,
    Deep.

    Can you paste the total code.
    santhosh

  • Internal table logic - help required

    Hi,
    I am working on BSEG table to determine offsetting line count and amount total for a posting line item and need
    a small logic .
    I have a table of currency fields like below and the table is such ( like BSEG ) that each line item will balance
    itself with other line item . For example
    Item
    10      100
    20      100-
    30      200
    40      250
    50      450-
    60      200-
    70      200
    80      600
    90      100
    100     200
    110     300
    If you see 10 & 20 balance out similarly ( 30,40 will balance with line item 50 ) , ( 60 & 70 balance each other ) ,
    ( 90,100, 110 balance with 80 ).
    My requirement - If I loop on item 50 with amount 450- I need to get the posnr of the two items which balance
    this amount ( which is 30 and 40 ).  If I loop on item 80 with amount 600 then I need to get item 90. 100 and 110.
    Please provide me a logic which will provide me the index of ther required item lines.
    Regards
    Praneeth

    Hi, execute this code.. might be helpful to you
    TYPES: BEGIN OF test,
             a TYPE i,
             b TYPE i,
           END OF test.
    DATA: itab TYPE TABLE OF test,
           wa  TYPE test,
           wa1 TYPE test,
           c   TYPE i,
           d   TYPE i,
           n1  TYPE i,
           n2  TYPE i.
    PARAMETERS :  p TYPE i.
    wa-a = 1.
    wa-b = 20.
    APPEND wa TO itab.
    wa-a = 2.
    wa-b = 30.
    APPEND wa TO itab.
    wa-a = 3.
    wa-b = 10.
    APPEND wa TO itab.
    wa-a = 4.
    wa-b = 10.
    APPEND wa TO itab.
    wa-a = 5.
    wa-b = 20.
    APPEND wa TO itab.
    READ TABLE itab INTO wa WITH KEY a = p.
    c = wa-b.
    LOOP AT itab INTO wa WHERE a GT p.
       n1 = wa-a.
       IF c EQ wa-b.
         EXIT.
       ENDIF.
       LOOP AT itab INTO wa1 WHERE a GT wa-a.
         IF wa-a = wa1-a.
           EXIT.
         ENDIF.
         n2 = wa1-a.
         d  = wa-b + wa1-b.
         IF c EQ d.
           EXIT.
         ENDIF.
       ENDLOOP.
       IF wa-a = wa1-a.
         EXIT.
       ELSEIF c EQ d.
         EXIT.
       ELSE.
         CLEAR: n1, n2.
       ENDIF.
    ENDLOOP.
    WRITE: n1 , n2.

  • Internal table logic required

    Hi ,
    I have two internal tables having with different structures . Finally I need to pass data to final internal table.
    In runtime we have data in only one table.  The final internal table should take either internal1, or internal table 2.
    it_final_data[] = it_first_data[].
    or
    it_final_data[] = it_sec_data[].
    i have to one generic include , it will understands the IT_final_data internal table only.
    please help me.
    regards,
    Ajay

    Hi Ajay,
         Build your final internal table with all the fields from first and second internal table. Use the below logic to move the data to the final internal table depending on the internal table data which you want to display.
    IF not it_first_data[] is initial.
      loop at it_first_data.
        move-corresponding it_frist_data to it_final_data.
        append it_final_data.
    endloop.
    else.
       loop at it_second_data.
        move-corresponding it_second_data to it_final_data.
        append it_final_data.
      endloop.
    endif.
    Hope this works for you.
    Regards,
    Jayaram

  • Internal Table Logic Needed

    Hi all,
    I have a requirement regarding data processing in a internal table,
    internal table consists of filelds Vendor,Material and Scheduling Dates and Total Qty.
    Here i need to fill the field Total Quantity, individual addition of quanties of that material for a particular vendor .
    Let us consider intitially my internal table consists of data like this with these fields.
                      Vendor ,           Material  ,            qty(individual),   Total qty   ,  Schedule dates
                       v1        ,           m1       ,                 10          
                       v1        ,           m1        ,                10
                       v1       ,             m1       ,                  20
                       v1       ,              m2      ,                    5
                       v1       ,             m2        ,                 10
                       v2        ,            m2         ,                20
                      v2        ,             m2        ,                  15
                      v2        ,            m3         ,                  20
                      v2        ,            m3           ,                10
        Initiall the total qty field is empty i need to fill tht field for the last item for a particular material Like M1
      for vendor v1 and total qty of m2 for vendor v1, total qty of m1 for v2, total qty of m2 for v2 and so on.
    Requied output should be like this.
                     Vendor     ,          Material       ,    qty(individual)            Total qty   Schedule dates
                      v1         ,                m1         ,         10           ,               0        
                       v1          ,              m1          ,        10           ,                 0
                       v1         ,                m1         ,         20          ,                40(101020)
                       v1        ,                 m2          ,         5           ,               0
                       v1          ,               m2           ,      10            ,              15(5+10)
                       v2          ,               m2          ,        20            ,             0    
                       v2          ,               m2           ,       15             ,              35(20+15)
                      v2           ,              m3          ,        20              ,             0
                      v2            ,              m3           ,       10              ,           30(20+10)
    Here i made one thing , i calculated the total qty of material for particular vendor.
    Like              
             Vendor                           Material                     Total Qty      
                     v1        ,                        m1            ,             40
                     v1        ,                       m2              ,            15
                     v2         ,                     m2                ,           35
                     v2          ,                    m3                 ,           30
    Finally i need the logic by using Control Events(At New   , At End of )  to adjust that total qty of a material for a particular vendor by Modifying the internal table.
    i hope my problem is clear , pls let me know if any clarifications needed. and
    code for the same .
    Thannks in advance,
    Niranjan.

    Hi,
    Solution is here.
    sort itab by vendor material.
    field-symbols: <itab> like line of itab.
    loop at itab assigning <itab>.
    on change of vendor.
    clear flag.
    endon.
    add <itab>-quanity to lw_quantiy.
    *--here pdate internal table end of each similar kind of record
    at end of.
    flag = 'x'.
    <itab>-totalqty =  lw_quantiy.
    clear  lw_quantiy
    endat.
    *--rest of record update zero by checking flag
    if flag is initial.
    <itab>-totalqty = 0.
    endif.
    endloop.
    close this thread if you got solution.
    Regards,
    Peranandam

  • Inserts/Updates on replicated tables Logical Standby Database ??

    Hello all,
    We have a Logical standby database on 10.2.0.5. Can you please suggest if there is a way we can do data inserts/updates on replicated tables ?
    Can this be done by doing a alter database guard none; or alter session disable|enable guard; ?? Even if it completes succesfully , will this have any effect on replication later ?

    Hello all,
    We have a Logical standby database on 10.2.0.5. Can you please suggest if there is a way we can do data inserts/updates on replicated tables ?
    Can this be done by doing a alter database guard none; or alter session disable|enable guard; ?? Even if it completes succesfully , will this have any effect on replication later ?

  • Error while transferin intenal table data to application server

    *& Report  YGL_BALANCES
    REPORT  YGL_BALANCES.
    TABLES:BAPI1028_0,BAPI1028_4,faglflext.
    data: f_glacc(10) type c  value 'flgl.text' .
    DATA: BALANCE LIKE BAPI1028_4-BALANCE,
          RETUR LIKE BAPIRETURN,
          FISC_YEAR LIKE BAPI1028_4-FISC_YEAR,
          FIS_PERIOD LIKE BAPI1028_4-FIS_PERIOD,
          DEBITS_PER LIKE BAPI1028_4-DEBITS_PER,
          CREDIT_PER LIKE BAPI1028_4-CREDIT_PER,
          PER_SALES LIKE BAPI1028_4-PER_SALES.
    data:prctr like faglflext-prctr,
         racct like faglflext-racct,
         rbukrs like faglflext-rbukrs.
    types: begin of   st_i ,
          COMP_CODE LIKE BAPI1028_4-COMP_CODE,
          GL_ACCOUNT LIKE BAPI1028_4-GL_ACCOUNT,
          FISC_YEAR(4),
          FIS_PERIOD(2),
          DEBITS_PER(23),
          CREDIT_PER(23),
          PER_SALES(23),
          BALANCE(23),
          CURRENCY LIKE BAPI1028_4-CURRENCY,
          CURRENCY_ISO(3),
         END OF st_i.
    DATA: ITAB like BAPI1028_4 OCCURS 10 WITH HEADER LINE.
    ***********************************************************************jtab like faglflext occurs 0 with header line.
    PARAMETERS: COMPCODE LIKE BAPI1028_0-COMP_CODE,
                CURRENCY LIKE BAPI1028_5-CURR_TYPE,
                YEAR LIKE BAPI1028_4-FISC_YEAR,
                ACCOUNT LIKE BAPI1028_0-GL_ACCOUNT.
    CALL FUNCTION 'BAPI_GL_GETGLACCPERIODBALANCES'
      EXPORTING
        COMPANYCODE                   = COMPCODE
        GLACCT                        = ACCOUNT
        FISCALYEAR                    = YEAR
        CURRENCYTYPE                  = CURRENCY
    IMPORTING
       BALANCE_CARRIED_FORWARD       = BALANCE
       RETURN                        = RETUR
      TABLES
        ACCOUNT_BALANCES              = ITAB.
        open dataset f_glacc for output in text mode encoding  default.
       loop at itab .
        transfer itab to f_glacc.
       endloop.
        close dataset f_glacc.
    iam getting error like this
    Runtime Errors         UC_OBJECTS_NOT_CHARLIKE
    Date and Time          01/16/2006 07:09:51
    ShrtText
    The current statement is defined for character-type data objects only.
    What happened?
    Error in ABAP application program.
    The current ABAP program "YGL_BALANCES" had to be terminated because one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    Error analysis
    Only character-type data objects are supported at the argument
    position "f" for the statement
    "TRANSFER f TO ...".
    In this case, the operand "f" has the non-character-type "BAPI1028_4". The
    current program is flagged as a Unicode program. In the Unicode context,
    type X fields are seen as non-character-type, as are structures that
    contain non-character-type components.
    Trigger Location of Runtime Error
    Program                                 YGL_BALANCES
    Include                                 YGL_BALANCES
    Row                                     48
    Module Name                             START-OF-SELECTION
    Source Code Extract
    Line
    SourceCde
    18
    FIS_PERIOD LIKE BAPI1028_4-FIS_PERIOD,
    19
    DEBITS_PER LIKE BAPI1028_4-DEBITS_PER,
    20
    CREDIT_PER LIKE BAPI1028_4-CREDIT_PER,
    21
    PER_SALES LIKE BAPI1028_4-PER_SALES,
    22
    23
    ITAB LIKE BAPI1028_4 OCCURS 10 WITH HEADER LINE.
    24
    *data : wa like itab.
    25
    26
    PARAMETERS: COMPCODE LIKE BAPI1028_0-COMP_CODE,
    27
    CURRENCY LIKE BAPI1028_5-CURR_TYPE,
    28
    YEAR LIKE BAPI1028_4-FISC_YEAR,
    29
    ACCOUNT LIKE BAPI1028_0-GL_ACCOUNT.
    30
    31
    CALL FUNCTION 'BAPI_GL_GETGLACCPERIODBALANCES'
    32
    EXPORTING
    33
    COMPANYCODE                   = COMPCODE
    34
    GLACCT                        = ACCOUNT
    35
    FISCALYEAR                    = YEAR
    36
    CURRENCYTYPE                  = CURRENCY
    37
    IMPORTING
    38
    BALANCE_CARRIED_FORWARD       = BALANCE
    39
    RETURN                        = RETUR
    40
    TABLES
    41
    ACCOUNT_BALANCES              = ITAB.
    42
    43
    *OPEN DATASET file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    44
    *TRANSFER `1234567890` TO file.
    45
    46
    open dataset f_glacc for output in text mode encoding  default.
    47
    loop at itab .
    >>>>>
    transfer itab to f_glacc.
    49
    endloop.
    50
    close dataset f_glacc.
    51
    52
    53
    54
    *CALL FUNCTION 'WS_DOWNLOAD'
    55
    EXPORTING
    56
      BIN_FILESIZE                  = ' '
    57
      CODEPAGE                      = ' '
    58
       FILENAME                      = 'C:\KLN.TXT'
    59
       FILETYPE                      = 'DAT'
    60
      MODE                          = ' '
    61
      WK1_N_FORMAT                  = ' '
    62
      WK1_N_SIZE                    = ' '
    63
      WK1_T_FORMAT                  = ' '
    64
      WK1_T_SIZE                    = ' '
    65
      COL_SELECT                    = ' '
    66
      COL_SELECTMASK                = ' '
    67
      NO_AUTH_CHECK                 = ' '

    Hi ,
    what is that file type .text ...?
    there is some problem as i understand from ur code ...
    There actually u have to mention application server path
    with file name...
    go thru this code ..I hope it will be helpful for u
    ELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001
    PARAMETERS    :  p_afile LIKE filename-fileintern LOWER CASE.
    SELECTION-SCREEN END OF BLOCK a.
    OPEN DATASET p_afile FOR OUTPUT IN TEXT MODE.
    *Display this message if the file is not opened successfully
      IF sy-subrc NE 0.
        MESSAGE e006 WITH 'Error in opening Server file'.
      ELSE.
        LOOP AT it_display.
          TRANSFER it_display TO p_afile.
        ENDLOOP.
        IF sy-subrc EQ 0.
          WRITE : /'File posted successfully'.
        ENDIF.
    *Close dataset
        CLOSE DATASET p_afile.
    *Display this message if the file is not closed
        IF sy-subrc NE 0.
          MESSAGE e006 WITH 'Error in closing Server file'.
        ENDIF.
      ENDIF.

  • Intenal table  as container variable in the alert category

    Hi
    Is it possible  to create   internal table as Container Variable in the alert category. If it is possible how can we pass the data to this internal table in the Run time to the funtion module SALRT_CREATE_API.I have tried this to pass the data to the container parameter
    it_container ,but i was unable to achive it .If anyone has come across this please guide me .
    Thanks and Regards,
    Venkat

    You can use the Forms "From Clause Query" as the datasource for the data block. Then you can change the QUERY_DATA_SOURCE_NAME using set_block_property, so you can use any SQL statement you like. Of course you must name/alias the columns in a consistent manner so that the number of database items on the block matches those being queried.

  • Transfer intenal table to file

    Hi abaers,
    i need to transfer the internal table data to file,,this file to create in application server.
    internal table lineitems contains 100 fields...
    i tried in the following method: but 100 fields i have to move each and evry field to t_output-data.. so it is becoming complex.
    data: begin of t_output occurs 0,
         data(800),
       end of t_output.
    loop at lineitems.
    t_output-data(4) = lineitems-COMP_CODE.
    t_output-data+4(10) = lineitems-VENDOR.
    append t_output.
    clear t_output.
    endloop.
       open dataset filename for output in text mode encoding default.
       loop at t_output.
          transfer t_output-data to filename.
         clear t_outpu-data.
       endloop.
       close dataset filename.
    endif.
    is there any other method to do direct transfer from internal table to file..

    Hi,
    I think FM: GET_COMPONENT_LIST would be very useful to u.
    i have attached the complete code and it's working absolutely fine with me.
    Code **********
    types: begin of type_item,
            f1(3),
            f2(3),
            f3(3),
            f4(3),
           end of type_item.
    types: begin of type_data,
            data(800),
           end of type_data.
    data : lineitems type table of type_item with header line,
           t_output type table of type_data with header line,
           fieldlist type table of RSTRUCINFO with header line.
    lineitems-f1 = 'a1'.
    lineitems-f2 = 'a2'.
    lineitems-f3 = 'a3'.
    lineitems-f4 = 'a4'.
    append lineitems.
    lineitems-f1 = 'b1'.
    lineitems-f2 = 'b2'.
    lineitems-f3 = 'b3'.
    lineitems-f4 = 'b4'.
    append lineitems.
    lineitems-f1 = 'c1'.
    lineitems-f2 = 'c2'.
    lineitems-f3 = 'c3'.
    lineitems-f4 = 'c4'.
    append lineitems.
    lineitems-f1 = 'd1'.
    lineitems-f2 = 'd2'.
    lineitems-f3 = 'd3'.
    lineitems-f4 = 'd4'.
    append lineitems.
    field-symbols : <fs> type any.
    CALL FUNCTION 'GET_COMPONENT_LIST'
      EXPORTING
        PROGRAM    = sy-repid
        FIELDNAME  = 'lineitems'
      TABLES
        COMPONENTS = fieldlist.
    data : fieldname like fieldlist-compname,data_line type type_data,dref
    type ref to data.
    format color 3.
    loop at lineitems REFERENCE INTO dref. .
    loop at fieldlist.
        fieldname =  fieldlist-compname .
        assign dref->(fieldname) to <fs>.
      concatenate data_line <fs> into data_line .
    endloop.
    append data_line to t_output.
    clear data_line.
    endloop.
    loop at t_output.
      write:/ t_output.
    endloop.
    Code *************
    If u still have any issues please revert back.
    Hope it'll help u.
    Regards,
    Ankur

Maybe you are looking for

  • When the Beta of WLI9.1 will be Out..

    Hi All, When is BEA planning to release the beta versin of 9.1 Integration. (The beta version of Portal is out ). I a curious to know what changes are on the cards as far as workflows are concerned and the support for BPEL etc... Thanks Sateesh

  • Is there a  MySQL Guru out there?

    FROM timesheets WHERE shCOMPID = colname ORDER BY shWEEKENDING DESC SELECT DISTINCT (shWEEKENDING) FROM timesheets WHERE shCOMPID = colname Hi, I have a table of employee Timesheets that have a pk, companyID and EmployeeID and a weekending (YYYY-MM-D

  • What is Condition (which is a push button) in MMR

    hi What is Condition (which is a push button) in MMR-Sales Org1 ? which is very smiler to the condition record but it is applicable only PR00 and if u know pls tell me in which situation we will use it? how can change in to the other conditions also?

  • ORA-06512 - Need some direction

    HPUX platform 10.2.0.2 Oracle. So I've been trying to track this dow myself, and I understand what the error means and what needs to be done. In my case: ORA-20000: ORA-06502: PL/SQL: numeric or value error: character string buffer too small -6502 OR

  • Error Log study

    Hello Xperts, Can anyone let me know the usage of error log tcodes in BW such as :- 1) SM21 2) SLG1 3) ST22 If any other logs are also present please let me know. Points would be assigned to good answers. Thanks in advance Rohit