Passing a program defined internal table to an abap object

Hi. I have an internal table that was previously defined and created by SAP that I need to process in a user exit. The table is defined exactly as shown below.
Is it possible to pass a table that was defined in this manner (not in the ABAP dictionary) as an argument to a method of an ABAP object?
If so, what would the data type of the itab parameter have to be when defining the object's method parameter list? Is it necessary to somehow "cast it" to the KNA1 table type once I receive the table into the method? If so, what is the data type of the object's receiving variable/attribute?
data: begin of lkna1 occurs 0001.
        include structure kna1 .
data:
      end of lkna1 .
Just as one additional piece of information, I am using version 4.5B and I am trying to do this through se24.
Thanks so much!

Hi again,
<b>This kind of simple approach,
we can pass ANY KIND OF TABLE
WITHOUT HAVING TO DEFINE
LINE TYPE IN SE11.</b>
1. doing this simply u will achieve what u want.
  ( i just tried the same)
2. in se24,
  give like this
ITAB     Importing     Type     <b>STANDARD TABLE</b>
3. in the calling program,
  call like this,
report abc.
data: begin of lkna1 occurs 0001.
include structure kna1.
data: end of lkna1.
data: testobj type ref to zsdtest.
select * from kna1
into table lkna1.
lkna1-kunnr  = '000234'.
create object testobj.
<b>call method testobj->testreceive
exporting itab = lkna1[].</b>
4.
then in the class, source code,
just use like this
(so that u can accesss the fields of the itab,
using myitab)
<b>method TESTRECEIVE .
data : myitab type table of kna1.
myitab[] = itab[].
break-point.
endmethod.</b>
5. thats all !
regards,
amit m.

Similar Messages

  • Internal table modification in ABAP object event

    Hi Gurus
    I have an internal table displayed using ALV - OOPS concept. THe internal table has 15 rows in my test program but it can go up depending on user inpout.
    I am able to display it . on the screen . One of the fields is editable . It is required that it take input from user and on pressing enter , the value entered in that cell should be subtracted from a total amout displayed in the cell next to it.
    I have used the following code . There are no errors , but nothing happens when I edit it. The screen remains as it is.
    Any help will be very useful
    DATA : ITAB type ITABT occurs 0.
    DATA : itab_w  like line of  itab.
    CLASS LCL_EVENTS_D0100 IMPLEMENTATION.
    METHOD handle_data_changed.
    DATA: ls_good TYPE lvc_s_modi.
    DATA : L_PLANETYPE TYPE ITABT-SEL_QUANT.
    LOOP AT er_data_changed->mt_good_cells INTO ls_good.
          CASE ls_good-fieldname.
    check if column PLANETYPE of this row was changed
            WHEN 'SEL_QUANT'.
              CALL METHOD pr_data_changed->get_cell_value
                 EXPORTING
                   i_row_id = ls_good-row_id
                   i_fieldname = ls_good-fieldname
                 IMPORTING
                   e_value = l_planetype.
          ENDCASE.
          LOOP AT ITAB INTO ITAB_W .
          read table itab into itab_w WITH KEY FINDEX = LS_GOOD-ROW_ID .
          itab_w-f_balquant = itab_w-f_balquant - l_planetype.
          modify itab FROM itab_w .
        endloop.
          ENDLOOP.
    ENDMETHOD.
    ENDCLASS.

    Hi,
    Hi,
    AND also use
    * Module Pai INPUT                                                     *
    * PAI module                                                           *
    module pai input.
      save_ok = ok_code.
      clear ok_code.
      call method grid1->check_changed_data
        importing
          e_valid = v_valid.
    " After this system will automatically update your changed data into
    " internal table t_zthlog
      case save_ok.
        when 'EXIT'.
          perform f_exit_program.
        when 'CANC'.
          perform f_exit_program.
        when 'BACK'.
          perform f_exit_program.
        when 'SAVE'.
          perform f_save_data.
      endcase.
    endmodule.                               " Pai INPUT
    aRs

  • How to Define Internal Table in Smartform

    Hello,
    I have some problem on define Internal Table in Smartform
    I define a Temp_IT_Gen Type LBBIL_IT_GEN in Global Definiations
    but i find that it is not available for me to append data into it,
    the error message is Temp_IT_Gen is not a Internal Table - the Occurs n Specification is missing
    so how can i solve it?
    i want to use the internal table in the hold program.
    Thanks a lot in advance.

    Hi,
    First U define the Table type in 'TYPES' tab of Global Definitions and then assing that table type to Internal table in 'Global Data' tab.
    Eg:
    define the Table Type like below in TYPES tab.
    TYPES:BEGIN OF ty_TEMP.
            INCLUDE STRUCTURE XXXXXXX.
    TYPES:END OF ty_TEMP.
    TYPES: g_t_temp TYPE STANDARD TABLE OF ty_TEMP .
    Now, define the Internal table in Global Data tab like below:
    Variable Name    Type assignment    Associated Type
    G_T_ITEM_1       TYPE                    G_T_TEMP
    NOTE: whatever U define in Global Definitions can be used only in SMARTFORM, if u want to use it in Program U must define in Form Interface.
    Hope it helps!!
    Rgds,
    Pavan

  • How to define internal table in smartform(urgent)

    Hi all,
    How can i define a internal table <b>with header line </b> in global data ???
    i defined like
    In Types,
    TYPES : BEGIN OF T_XVBPLP2 ,
             VENUM(10),
             VEPOS(10),
             POSNR(6),
             VEMNG LIKE LIPS-LFIMG,
             MATNR LIKE LIPS-MATNR,
             CHARG LIKE LIPS-CHARG,
             ARKTX LIKE LIPS-ARKTX,
             END OF T_XVBPLP2.
    TYPES: T_XVBPLP TYPE TABLE OF T_XVBPLP2.
    In Global Data,
    T_XVBPLP TYPE T_XVBPLP.
    Still, i am getting error message that, Internal table is not with header line.
    can u plz give me some examples , to  define internal table with header line in smartform ???
    any correct answers will be rewarded??
    Regards
    pabitra

    Hi
    define WA_ITAB  in Global variables
    variable name          type assin      associated type
    t_text                      like                     zstc_text
    you cannot define a internal table with header line in SMART Forms. Declare a internal table and a work area separately both referring to the same structure.
    Then you can use the work area. So, in this case WA_ITAB is declared as a global variable of TYPE ZSTC_TEXT.
    Regards
    Pavan

  • How can i pass calculated value to internal table

    Hi
    i have to pass calculated value into internal table
    below field are coming from database view and i' m passing view data into iznew1
    fields of iznew1
                 LIFNR  LIKE EKKO-LIFNR,
                 EBELN  LIKE EKKO-EBELN,
                 VGABE  LIKE EKBE-VGABE,
                 EBELP  LIKE EKBE-EBELP,
                 BELNR  LIKE EKBE-BELNR,
                 MATNR  LIKE EKPO-MATNR,
                 TXZ01  LIKE EKPO-TXZ01,
            PS_PSP_PNR  LIKE EKKN-PS_PSP_PNR,
                 KOSTL  LIKE EKKN-KOSTL,
                 NAME1  LIKE LFA1-NAME1,
                 NAME2  LIKE LFA1-NAME2,
                 WERKS  LIKE EKPO-WERKS,
                 NETWR  LIKE EKPO-NETWR,
                 KNUMV  LIKE EKKO-KNUMV,
                 GJAHR  LIKE EKBE-GJAHR,
    and now i want to pass
    one field ED1  which i has calculated separatly and i want to pass this value into iznew1
    but error is coming that iznew1 is a table with out header line  has no component like ED1.
    so how can i pass calculated value to internal table iznew1,

    When you declare your internal table , make an addtion occurs 0
    eg . data : begin of iznew occurs 0 ,
                    fields ...
       add the field here ed1.
               end of iznew.
    now when you are calculating the value of ed1,
    you can pass the corresponding value of  ed1 and modify table iznew.
    eg
    loop at iznew.
    iznew-ed1 = ed1.
    modify iznew.
    endloop.

  • Passing a value from internal table to a powerpoint slide

    Hi,
    Does anyone know how to pass a value from internal table to a powerpoint slide?  I would also need some codes with regards to the coding to open the powerpoint and insert the value in.
    Thanks.
    Points will be awarded.
    Hope to hear from you soon.
    Lawrence

    geez!! do feel sorry for you
    you can fire FM WS_EXECUTE to open power point but passing a variable at run-time i'm not sure, sorry.

  • Submititng the program to another program  using internal table values

    Hi All,
    How to Submit from one program to another program using internal table values minimum 7 int tables without using the seletion screen
    thanks
    raj

    Hi All,
    Thank you very much for your inputs.
    i am facing another issue:
    For each 10,000 records it should trigger a job  (we are trying to call a program)  were the validation will be done only through the other program.
    please find the code mentioned below :
    TABLES : but000.
    DATA:  int_bp LIKE but000 OCCURS 0 WITH HEADER LINE.
    data released like BTCH0000-CHAR1.
    DATA: jobnumber LIKE tbtcjob-jobcount, " Job ID and
          jobname LIKE tbtcjob-jobname, " job name.
          startdate LIKE tbtcjob-sdlstrtdt, " Start-time
          starttime LIKE tbtcjob-sdlstrttm, " window specs.
          laststartdate LIKE tbtcjob-laststrtdt,
          laststarttime LIKE tbtcjob-laststrttm,
          job_released LIKE btch0000-char1. " JOB_CLOSE: Was job released?
    DATA : l1 TYPE i,
           b_size TYPE i,
           b_cursor TYPE cursor.
    INITIALIZATION.
      b_size = 5000.
    START-OF-SELECTION.
      OPEN CURSOR WITH HOLD b_cursor
         FOR
         SELECT *
         FROM but000
         WHERE bpkind = 'AA'.
      IF sy-subrc = 0.
        DO.
          FETCH NEXT CURSOR b_cursor INTO TABLE int_bp
                                               PACKAGE SIZE b_size.
    Note : here in this point  we are getting a dump for the second job trigger.
          IF sy-subrc = 0.
            CLEAR jobname.
            CONCATENATE sy-repid sy-datum sy-uzeit INTO jobname.
    export int_bp to memory id 'ABC'.
            CALL FUNCTION 'JOB_OPEN'
                 EXPORTING
                      jobname          = jobname
                 IMPORTING
                      jobcount         = jobnumber.
                EXCEPTIONS
                     cant_create_job  = 1
                     invalid_job_data = 2
                     jobname_missing  = 3
                     OTHERS           = 4
    CALL FUNCTION 'JOB_SUBMIT'
          EXPORTING
               authcknam = sy-uname
               jobname   = jobname
               jobcount  = jobnumber
               report    = 'YTEST_RRR'.
               variant   = lv_variant.
       SUBMIT ytest_rrr
          VIA JOB jobname NUMBER jobnumber
          AND RETURN.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
           event_periodic                    = 'X'
            jobcount                          = jobnumber
            jobname                           = jobname
            strtimmed                         = 'X'
          IMPORTING
            job_was_released                  = released
            else.
            EXIT.
          ENDIF.
        ENDDO.
    calling program :
    REPORT YTEST_RRR .
    data itab1 like but000 occurs 0 with header line.
    data l type i.
    import itab1 from memory id 'ABC' .
    describe table itab1 lines l.
    free memory id 'ABC'.
    write:/ 'total records are:', l.
    Please give your suggestion why its going for  dump in the second iteration.
    thanks in advance.

  • Defining internal table dynamcially...

    Hello Gurus,
    Currently I am defining internal table as follows. The custom table name is ZCUST.
    data: itab LIKE ZCUST OCCURS 1 WITH HEADER LINE.
    But I have a situation where I have to define a internal table dynamcially based on the
    table name defined in configuration table.
    How can I define itab dynamically where custom table name will be selected at runtime ?
    Regards,
    Rajesh.

    This question has been asked and answered many times before. Please search the forum before asking.
    Rob

  • Internal table declaration -OO ABAP

    Hi,
              I am looking to declare an internal table using OO objects. My declaration are as follows..
    TYPES : Begin of itab,
                         f1 type c,
                         f2 type c,
                 End of itab.
    DATA : itab1 type standard table of itab.
    DATA: wa_tab type itab.
    I have an internal table to say itab_pa2001 which i am reading all the records of pernr into ITAB_PA2001.To get the text i want to select * from t5*** into ..... Finally wht am looking is to move some of the fields into the final table ITAB. Could you please let me know how to set this up as i am getting wrong values when i am looping as below.
    how to declare a structure in ITAB using ABAP OO....??
    LOOP at ITAB_PA2001 into wa_itab.
    ENDLOOP.
    Thanks,
    Vind

    Hi,
    Please refer to following links :
    [How to declare an internal table in OO-ABAP programming? |Re: How to  declare an internal table in OO-ABAP programming?;
    [sample object oriented ABAP program |http://wiki.sdn.sap.com/wiki/display/Snippets/sampleobjectorientedABAPprogram]
    Hope this helps.
    Regards,
    Chandravadan

  • To know the functionality of table control in ABAP Objects

    Hi,
    Is there any technique to achieve the functionality of table conrol in ABAP Objects?
    Thanks.

    Hello Raja
    If you are using an editable ALV grid then you have the functionality of a table control and much much more.
    ABAP-OO based ALV grids are much more powerful (and easier) than simple table controls.
    Regards
      Uwe

  • Can't we pass custom defined internal table in SMARTFORM Interface

    Hi,
         I have a scenario, that my internal table from the program is is not dictionary type, but combination of some fields. Can't I directly pass this table to my smartform.
    Thank U 4 Ur time.
    Cheers,
    Sam

    hi,
    We can not pass the Internal tables to a Smartforms, you need to create the Structure and give the Structure in the Smartform, and declare the the internal table of that structure type and pass it
    Regards
    Sudheer

  • Passing data to different internal tables with different columns from a comma delimited file

    Hi,
    I have a program wherein we upload a comma delimited file and based on the region( we have drop down in the selection screen to pick the region).  Based on the region, the data from the file is passed to internal table. For region A, we have 10 columns and for region B we have 9 columns.
    There is a split statement (split at comma) used to break the data into different columns.
    I need to add hard error messages if the no. of columns in the uploaded file are incorrect. For example, if the uploaded file is of type region A, then the uploaded file should be split into 10 columns. If the file contains lesser or more columns thenan error message should be added. Similar is the case with region B.
    I do not want to remove the existing split statement(existing code). Is there a way I can exactly pass the data into the internal table accurately? I have gone through some posts where in they have made use of the method cl_alv_table_create=>create_dynamic_table by passing the field catalog. But I cannot use this as I have two different internal tables to be populated based on the region. Appreciate help on this.
    Thanks,
    Pavan

    Hi Abhishek,
    I have no issues with the rows. I have a file with format like a1,b1,c1,d1,e1, the file should be uploaded and split at comma. So far its fine. After this, if the file is related to region A say Asia, then it should have 5 fields( as an example). So, all the 5 values a1,b1..e1 will be passed to 5 fields of itab1.
    I also have region B( say Europe)  whose file will have only 4 fields. So, file is of the form a2,b2,c2,d2. Again data is split at comma and passed to itab2.
    If some one loads file related to Asia and the file has only 4 fields  then the data would be incorrect. Similar is the case when someone tries to load Europe file with 5 fields related data. To avoid this, I want to validate the data uploaded. For this, I want to count the no. of fields (seperated by comma). If no. of fields is 5 then the file is related to Asia or if no. of fields is 4 then it is Europe file.
    Well, the no. of commas is nothing but no. of fields - 1. If the file is of the form a1,b1..e1 then I can say like if no. of commas = 4 then it is File Asia.But I am not sure how to write a code for this.Please advise.
    Thanks,
    Pavan

  • Passing SELECT-OPTIONS and Internal Tables to SUBROUTINES

    Hi Guys
    In the code below my colleague has created her own table types in order to pass a select option and internal tables to her subroutine. Is there an easier way of making them known to the subroutine.
    data : v_vbeln type vbeln_vf,
          it_bdoc type table of vbrp,
          it_t006 type table of t006a,
          wa_bdoc type vbrp,
          wa_t006 type t006a,
          it_bdoc2 type table of zsswathi_st_vbeln,
          wa_bdoc2 type zsswathi_st_vbeln
    select-options s_vbeln for v_vbeln matchcode object zswathi_vbeln obligatory.
    start-of-selection.
    perform bdoc using s_vbeln[]
                 changing it_bdoc
                          it_bdoc2
                          it_t006.
      loop at it_bdoc2 into wa_bdoc2.
    form bdoc using f_s_vbeln type ZSWATHI_ST_SELECT_OPTION_TA_TY       " all these are table types. for select options, a structure is created and then a table type for it is created.
            changing f_it_bdoc type zswathi_vbrp_ty_ta
                     f_it_bdoc2 type zswathi_vbeln_ty_ta
                      f_it_t006 type ZSWATHI_T006_TA_TY.
    select * from vbrp into table f_it_bdoc where vbeln in f_s_vbeln.
          if f_it_bdoc is not initial.
          select  vbeln sum( netwr ) prsdt from vbrp into table f_it_bdoc2 where vbeln in f_s_vbeln group by vbeln prsdt.
          sort f_it_bdoc2 by vbeln.
          "select * from t006a into table it_t006 for all entries in it_bdoc where msehi = it_bdoc-vrkme.
          select * from t006a into table f_it_t006 for all entries in f_it_bdoc where msehi = f_it_bdoc-vrkme.
       endif.
        endform.

    Hi Brett,
    1. you can use a select-options-range in a FORM subroutine also without passing it as a parameter because parameters and select-option range tables are global fields in their program.
    2. If you need a parameter, declare it as type table or type standard table or type any table. You do not need any special table type.
    Regards
    Clemens

  • Passing values to an internal table and use it with the table painter

    Hi,
    I have seen this topic here before but the answers didn't help me. Maybe I,m doing something wrong.
    The problem is that I defined the following structure on the |Types| tab of the |Global Definitions| section:
    TYPES: BEGIN OF DETAILS,
           EBELP  TYPE EKPO-EBELP,
           BSMNG  TYPE EBAN-BSMNG,
           LFDAT  TYPE RM06P-LFDAT,
    END OF DETAILS.
    Then defined the following definition on the |Global Data| section:
    WA_DETAILS TYPE STANDARD TABLE OF DETAILS WITH HEADER LINE
    The problem is that when I try to assign a value to one of the fields in the program code like this:
    LOOP AT WA_EKPO.
         WA_DETAILS-EBELP = WA_EKPO-EBELP.
         WA_DETAILS-EMATN = WA_EKPO-EMATN.
         MODIFY WA_DETAILS.
    ENDLOOP.
    gives me the following error:
    "WA_DETAILS" is not an internal table -the "OCCURS n" specification is missing.
    Then if I add the "OCCURS 10" to the definition of the Global Data the error "OCCURS 10" is not expected.
    How can I define, assign values and use as a parameter an internal table defined with types for use it with the table painter?

    Hi,
    if it is one record in wa_details. you can directly write as follows..
    REPORT  ZCR_TEST1                               .
    TYPES: BEGIN OF details,
              ebelp TYPE ekpo-ebelp,
              bsmng TYPE eban-bsmng,
              lfdat TYPE rm06p-lfdat,
              ematn TYPE ekpo-ematn,
           END OF details.
    DATA: wa_details TYPE STANDARD TABLE OF details WITH HEADER LINE,
          wa_ekpo    TYPE STANDARD TABLE OF details WITH HEADER LINE.
    wa_details-ebelp = '1'.
    append wa_details.
    wa_ekpo-ebelp = '3'.
    append wa_ekpo.
    LOOP AT wa_ekpo.
      wa_ekpo-ebelp = wa_details-ebelp.
      wa_ekpo-ematn = wa_details-ematn.
      modify wa_ekpo.
    endloop.
    Normally it wont be one record, so u need to put <b>read statement with key</b> in LOOP and ENDLOOP.
    Regards,
    Sriram

  • Regarding passing blank characters to internal table field

    Hi All,
    I have small issue.
    Actual issue is
    I am having one internal table field as <b>oper_table-arbid</b> in the program i will actually pass first 4 characters of that field into another internal table <b>i_download_operation-arbid.</b>
    Then if <b>oper_table-arbid</b> is blank i need to pass
    4 blank characters into <b>i_download_operation-arbid.</b>
    Can anybody tell me how can i do it.
    Code is like this
    IF oper_table-arbid NE space.
    MOVE oper_table-arbid+0(4) TO i_download_operation-arbid.
    ELSE.
    I need to pass 4 blank char's to i_download_operation-arbid
    ENDIF.
    oper_table-arbid is of 8 char length & i_download_operation-arbid is of 4 char length.
    Can any body tell me what i need to do here.
    Thanks in advance.
    Thanks & Regards,
    Rayeez.

    hi ,
    shaik.
    data: var(8) type c value 'abcdefgh'.
          write var.
    data: bar(8) type c value 'ijkl',
          p1(8)  .
          move bar to p1.
          write:/ p1 right-justified.
    just execute the program and see the o/p.
    if u r trying to pass character then default position is left-justfied .
    so u need to explicitly say right-justified so it will take positions 5,6,7,8.
    so here u need append blank spaces .
    after seeing the o/p u will hav a clear picture .
    vijay.

Maybe you are looking for

  • Sound wont play through headset

    All other sound comes through fine on my headset, like youtube and games and netflix. But when i am in call, the call comes through my speakers instead. I have already tried going through the skype settings to change the sound devices for speakers an

  • Agent cannot recieve call

    Hi, I have an agent configured in UCCX on a remote site. All of the CRS config should be correct and the agent can log on to the agent desktop. When a call is routed to the agent the status goes into reserved, then straight back to Not Ready (or Read

  • Photos missing from photo book

    I have recently opened iPhoto and have gone to do another photo book/Project, and was just checking an older book I made and have noticed some photos are missing from the book/Project? They are also not in the Album with all the photos I used for the

  • Function to obtain latest salary

    Hi Can anyone point out a function or API that can fetch latest salary of an employee? Regards - Saira

  • Need to create subroutine pool for info structure

    Hi gurus, I need to create a subroutine pool for the info strucuture S891for one of the key figures.(in the extended update rules). and in that i need to write 3 routines for the 3 key figures. plz help me how to create the subroutine pool for this.