Problem with accesing table field in subroutine

Hello All,
I am calling a subroutine multiple times and everytine passing 2 different tables (with different structures) int he subroutine.
PERFORM fill_itabs TABLES t_adnat_bus_in
                                           gt_adnat_bus_in_dummy
                               USING  p_filename..
PERFORM fill_itabs TABLES t_adcust_ban_in
                                           gt_adcust_ban_in_dummy
                              USING  p_filename.
The following is the subroutine definition.
FORM fill_itabs  TABLES   p_t_table
                          p_t_table_dummy
                 USING    p_filename     .
      p_t_table_dummy[] = p_t_table[].
      SORT p_t_table_dummy BY cust_id.
ENDFORM.
I am getting a syntax error which states -
<u><b>"The specified type has no structure and therefore no component called "cust_id"."</b></u>
The problem is the structure of the table passed to subroutine is different in the
different times when it is called and so in subroutine defintion I cannot mention an explicit structure for the table.
Could anyone please suggest how to avoid this?
Regards,
Indrajit.

Hi Indrajit,
you can add one more formal parameter to the subroutine, which will act as a flag.
while calling the subroutine, you can set the flag if cust_id field is there in the structure of the table, else dont set the flag.
And in the the subroutine, put check on the flag status before writing
p_t_table_dummy[] = p_t_table[].
SORT p_t_table_dummy BY cust_id.
Ex:
FORM fill_itabs TABLES p_t_table
                                     p_t_table_dummy
                        USING p_filename
                                   p_flag.
if p_flag eq 'X'.
p_t_table_dummy[] = p_t_table[].
SORT p_t_table_dummy BY cust_id.
endif.
ENDFORM.

Similar Messages

  • Problem with fetching table field

    Hi all, im explaining the problem, please provide me the query.
    i am having the follong tables
    1)location table contains one PK(loc_id)and authorization field, etc.
    2)accont table contain one FK(loc_id) and hrid , attuid fields etc
    3)LINE table contains INTERLATA_PIC_FREEZE & INTRALATA_PIC_FREEZE and some more fields.
    4)TRUNK table contains INTERLATA_PIC_FREEZE & INTRALATA_PIC_FREEZE and some more fields.
    5)NODAL_TSG table contains INTERLATA_PIC_FREEZE & INTRALATA_PIC_FREEZE and some more fields.
    6)REMOTE_CALL_FWD table contains INTERLATA_PIC_FREEZE & INTRALATA_PIC_FREEZE and some more fields.
    7)Order2misc table contains FK(SER_LOC_ID) of Location table
    PIC means INTERLATA_PIC_FREEZE/INTRALATA_PIC_FREEZE
    PLOC means INTERLATA_PIC_FREEZE/INTRALATA_PIC_FREEZE
    i need to send an authorization field value to another interface.
    condition
    ===========
    if(LOCATION.AUTHORIZATION using Account.loc_id is not null and LINE.INTERLATA_PIC_FREEZE not equal to 'F' and LINE.INTRALATA_PIC_FREEZE not equal to 'F' and similaraly for TRUNK, NODAL_TSG and REMOTE_CALL_FWD table fields)
    else
    fetch the authorization field from
    LOCATION.AUTHORIZATION using Order2misc.ser_loc_id
    =======
    please provide me the query.
    thanks in advance

    HI thanks for ur reply
    i tried lmy best.
    im able to put that into 2 queries, but i need to join both of them in single query
    query-1
    ======
    Select l.authorization
    from location l JOIN ACCOUNT a on a.loc_id = l.loc_id
    and l.authorization is not null
    where not exists
    select * from Line where INTERLATA_PIC_FREEZE = 'F' or INTRALATA_PIC_FREEZE = 'F'
    union all
    select * from trunk where INTERLATA_PIC_FREEZE = 'F' or INTRALATA_PIC_FREEZE = 'F'
    union all
    select * from NODAL_TSG where INTERLATA_PIC_FREEZE = 'F' or INTRALATA_PIC_FREEZE = 'F'
    union all
    select * from REMOTE_CALL_FWD where INTERLATA_PIC_FREEZE = 'F' or INTRALATA_PIC_FREEZE = 'F'
    query--2
    =======
    Select l.authorization
    from location l JOIN order2misc o on o.ser_loc_id = l.loc_id
    and l.authorization is null
    where exists
    select * from Line where INTERLATA_PIC_FREEZE = 'F' or INTRALATA_PIC_FREEZE = 'F'
    union all
    select * from trunk where INTERLATA_PIC_FREEZE = 'F' or INTRALATA_PIC_FREEZE = 'F'
    union all
    select * from NODAL_TSG where INTERLATA_PIC_FREEZE = 'F' or INTRALATA_PIC_FREEZE = 'F'
    union all
    select * from REMOTE_CALL_FWD where INTERLATA_PIC_FREEZE = 'F' or INTRALATA_PIC_FREEZE = 'F'
    ================
    i need a single query. and correct me if the above query's are wrong

  • Problem with modifying table field with SQL

    In a particular table, there are some values that end with a null character (ascii(0)) and we don't want them null-terminated. I've been trying to use the following SQL statement to find those fields and then remove the null character from the end (each record has a 'field_id' field and the 'value' field which holds the actual value of that field_id):
    update num_data
    set value = substr(value,1,instr(value,ascii(0))-1)
    where field_id = 'FIELD1'
    select field_id
    from num_data
    where ascii(substr(value,length(value),1)) = 0
    All it does is execute for several minutes before I just have to interrupt it, and no changes are made.

    I see I messed up; the query should have been:
    update num_data
    set value = substr(value,1,instr(value,ascii(0))-1)
    where field_id in
    select field_id
    from num_data
    where ascii(substr(value,length(value),1)) = 0
    But since I wrote this note, I ran that query again, and it worked as I wanted it to; maybe our DB was running slow at that time, though I waited a few minutes for results.
    I appreciate you two taking the time to respond.

  • Problem with a Dynpro field (type numc)

    hi everybody.
    I'm developping a ModulPool application in wich i have 2 RadioButtons with 2 textbox fields.
    What i pretend to do is, when the user clicks a radiobutton and strikes Intro, enable the corresponding textbox field and disable the other one.
    My code runs fine, but i have a little problem. When I loop the screen table, to set the appropiate value to the 'input' property, in this case, when i try to disable it (input = '0'), I get a zero character in that field. This field has NUMC type, i'm sure this is the problem
    'cos i've got no problem with the other field (type char). But i can't solve it.
    Anybody's got an idea?
    Thanks

    What you are seeing is the normal behavior of a numeric field represented by the SAPgui.  This is how all numeric fields are displayed via SAPgui.  If you don't want to see the 0,  then you just change the field type to CHAR and handle accordingly.
    Regards,
    Rich Heilman

  • I am getting problem with internal table & work area declaration.

    I am working with 'makt' table ..with the table makt i need to work with styles attributes ..so i declared like this
    TYPES : BEGIN OF ty_makt,
             matnr TYPE makt-matnr,
             spras TYPE makt-spras,
             maktx TYPE makt-maktx,
             maktg TYPE makt-maktg,
             celltab TYPE lvc_t_styl,
           END OF ty_makt.
    DATA : i_makt TYPE TABLE OF ty_makt.
    DATA : wa_makt TYPE ty_makt .
        But end of program i need to update dbtable "makt"...i am getting problem with internal table & work area declaration.
    i think makt table fields mapping and internal table/work area mapping is not correct. so please help me to get out from this.

    Hi Nagasankar,
    TYPES : BEGIN OF TY_MATNR,
                  MATNR TYPE MAKT-MATNR,
                  SPRAS TYPE MAKT-SPRAS,
                  MAKTX TYPE MAKT-MAKTX,
                  MAKTX TYPE MAKT-MAKTG,
                  CELLTAB TYPE LVC_T_STYL,  " Its Working perfectly fine..
                 END OF TY_MAKT.
    DATA: IT_MAKT TYPE STANDARD TABLE OF TY_MAKT,
              WA_MAKT TYPE TY_MAKT.
    Its working perfectly fine. if still you are facing any issue post your complete code.
    Thanks,
    Sandeep

  • Problem with a table control

    Hi gurus,
    I´ve a problem with a table control. It has 3 columns which one is a checkbox.
    I can fill all fields but in the moment I mark the checkbox this line must be unwritable. How can I do it?
    Thanks for all
    Dani

    Assign a function code to the checkbox column....
    so when u check / uncheck any entry, PAI + PBO will be triggered....
    In the PBO during the loop of table control, check the checkbox field value. if it is 'X', make the row readonly
    by looping at screen and setting screen-input = 0 for rest of the columns.
    like ...
    LOOP AT tc_itab
           WITH CONTROL tc_test
           CURSOR tc_test-current_line.
       module set_row_readonly. " loop at screen and set input = '0' if checkbox is checked...
    ENDLOOP.

  • Problem with maintain table views SM30 Transaction

    Hello All,
    i have a problem with the table maintenance view SM30, it doesn't permit me to modify the rows in the table.
    we have added a field into the table and when i tried to change the table view from menu: Utilities ==> table maintenance generator==> change the system propose me a message that the screen 0001 will be deleted and recreated...but the system has deleted the screen and doesn't recreate it...in somewehere on internet we find that we should use the transaction SE55 menu:
    Environment==> modification ==> Maintenance screen ==> button Layout which open the tool Screen Painter and from that we have created our screen with 4 fields of our table...our result that the screen is created and i can see it from the SM30 transaction but i can't insert rows in the table...when i try to go to maintain table: menu: Utilities ==> Table maintenance generator to try if i can modify something the system give me a message: "set the compare flag dialog ZIV_DP_PLCHAR_LA"
    the ZIV_DP_PLCHAR_LA is the name of my table...
    can you give me some advices please how should i do to fix this problem to insert rows in table throughout the transaction
    SM30 "maintain table views: initial screen"
    if i want to delete the screen from the SE55 transaction to recreate it newly what should i do to take care about some options
    to have a new screen?
    thanks for all
    Bilal

    Hi
    First delete the old table maintainence generator.
    Now Recreate the screen and your table is good to go..
    These error messages come when we add new fields and different version of the table maintainence generator in database.

  • Problem with the quantity field

    hi every one
    i am facing a problem with the quantity field (vbap-kwmeng)
    as per my requirement i need to display this quantity field along with some other item fields from VBAP in an alv grid.
    among all the fields displayed in the alv grid only this quantity field is editable(end user can change this quantity)
    once end user changes this quantity and press save button i need to capture this new quantity in my internaltable.
    problem is input of length of quantity is 15 and the output length is 19
    so when i am pressing save
    say my quantity is 50 when i am pressing save '0.050' is coming because of the length difference
    how can i capture the original changed value.
    vamsi

    what about define two fields in  you inner table ,one as char and the other as vbap-kwmeng, you can show the char one in the ALV gird , when user input value and press SAVE ,you can move the value to vbap-kwmeng.
    you can test it,mybe some one has one better idea.

  • Problems with partition tables

    Hi all,
    I've got some problems with partition tables. The script at the bottom run but when I wanna insert some values it returns me an error
    (ORA-06550: line 1, column 30: PL/SQL: ORA-06552: PL/SQL: Compilation unit analysis terminated
    ORA-06553: PLS-320: the declaration of the type of this expression is incomplete or malformed
    ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored)
    and I can't understand why!
    There's something incorrect in the script or not?
    Please help me
    Thanks in advance
    Steve
    CREATE TABLE TW_E_CUSTOMER_UNIFIED
    ID_CUSTOMER_UNIFIED VARCHAR2 (27) NOT NULL ,
    START_VALIDITY_DATE DATE NOT NULL ,
    END_VALIDITY_DATE DATE ,
    CUSTOMER_STATUS VARCHAR2 (255)
    PARTITION BY RANGE (START_VALIDITY_DATE)
    SUBPARTITION BY LIST (END_VALIDITY_DATE)
    PARTITION M200909 VALUES LESS THAN (TO_DATE('20091001','YYYYMMDD'))
    (SUBPARTITION M200909_N VALUES (NULL), SUBPARTITION M200909_NN VALUES (DEFAULT)),
    PARTITION M200910 VALUES LESS THAN (TO_DATE('20091101','YYYYMMDD'))
    (SUBPARTITION M200910_N VALUES (NULL), SUBPARTITION M200910_NN VALUES (DEFAULT)),
    PARTITION M200911 VALUES LESS THAN (TO_DATE('20091201','YYYYMMDD'))
    (SUBPARTITION M200911_N VALUES (NULL), SUBPARTITION M200911_NN VALUES (DEFAULT)),
    PARTITION M200912 VALUES LESS THAN (TO_DATE('20100101','YYYYMMDD'))
    (SUBPARTITION M200912_N VALUES (NULL), SUBPARTITION M200912_NN VALUES (DEFAULT)),
    PARTITION M201001 VALUES LESS THAN (TO_DATE('20100201','YYYYMMDD'))
    (SUBPARTITION M201001_N VALUES (NULL), SUBPARTITION M201001_NN VALUES (DEFAULT)),
    PARTITION M201002 VALUES LESS THAN (TO_DATE('20100301','YYYYMMDD'))
    (SUBPARTITION M201002_N VALUES (NULL), SUBPARTITION M201002_NN VALUES (DEFAULT)),
    PARTITION M210001 VALUES LESS THAN (MAXVALUE))
    (SUBPARTITION M210001_N VALUES (NULL), SUBPARTITION M210001_NN VALUES (DEFAULT))
    ;

    Hi Hoek,
    the DB version is 10.2 (italian version, then SET is correct).
    ...there's something strange: now I can INSERT rows but I can't update them!
    I'm using this command string:
    UPDATE TW_E_CUSTOMER_UNIFIED SET END_VALIDITY_DATE = TO_DATE('09-SET-09', 'DD-MON-RR') WHERE
    id_customer_unified = '123' and start_validity_date = TO_DATE('09-SET-09', 'DD-MON-RR');
    And this is the error:
    Error SQL: ORA-14402: updating partition key column would cause a partition change
    14402. 00000 - "updating partition key column would cause a partition change"
    *Cause:    An UPDATE statement attempted to change the value of a partition
    key column causing migration of the row to another partition
    *Action:   Do not attempt to update a partition key column or make sure that
    the new partition key is within the range containing the old
    partition key.
    I think that is impossible to use a PARTITION/SUBPARTITION like that: in fact the update of "END_VALIDITY_DATE" cause a partition change.
    Do u agree or it's possible an update on a field that implies a partition change?
    Regards Steve

  • Problems with a table in PDF`S footer

    Dear sirs,
    We are having problems when trying to run a PDF with Adobe LiveCycle Designer tool.
    We are working with a PDF which is composed of a header, the main body and a footer. We have created a table (table1) at the footer and
    another one at the main body (table2). This last table (table2) may overflow therefore it will genarate two pages for our PDF.
    On both pages appear the header and the footer correctly but in the last page it does not write the data from the table included in the footer (table1).
    We have no problems with the table included in the main body
    In the attachments, I send you the screenshots of both pages in which I have marked in red the part where we have error.
    May you help us to solve our problem?
    Thanks in advance your help.
    Edited by: emgaitan on Mar 16, 2010 2:18 PM

    Wardell,
    Check the data in RSA3 for the extractor that you use to bring data .
    You must be using the data source 0CO_OM_CCA_09. Check the data and reconcile and you will get it.
    Let me know if you need anything else.
    Thanks
    Ravi Thothadri
    [email protected]

  • Hi, I have problem with accesing Assets - Fonts (Synced Typekit fonts)!

    Hi, I have problem with accesing Assets -> Fonts (Synced Typekit fonts)!
    Can You help me with that problem?

    Hi Tarik,
    I'm sorry you ran into trouble here. There are a few things we can check right away to start debugging this:
    - First, would you try signing out of the Creative Cloud app and see if this solves the issue? This can be found under: Gear > Preferences > General > Account.
    - Could you try quitting/restarting the Creative Cloud app. Did this solve the issue?
    - Could you try Turning File and Font Sync off under: Gear > Preferences > Fonts. Wait a second, then turn it back on. See if the font/s show up and if not, try syncing again. Did this solve it?
    - Could you tell me if you're on the Windows/Mac OS X and the version?
    If none of those worked, would you attach the CoreSync files and send those to our support email: [email protected]?
    On the Mac, the folder can be found here:
    /Library/Application Support/Adobe/CoreSync/CoreSync-yyyy-mm-dd.log
    (You'll want to open the Finder, click Go, in the menu, hold down the "option" key and you'll see the Library folder.)
    On Windows:
    You can find the files under: C:\Users\user name\AppData\Roaming\Adobe\CoreSync\coreSync-2013-08-xx.log
    I know this is a lot. Thanks for your help here.
    Cheers,
    Benjamin

  • Problem with Pivot Table with Graph: Line Bar Combo

    Hello people!
    I have a problem with pivot table and line bar combo (all in the same view (pivot table))
    I have some measures and one dimension in my report.
    --------------measure1---measure2---measure3
    Dim A.1
    Dim A.2
    Dim A.3
    If I choose my graph line bar combo automatically choose "line" measure 3 (last measure in "Show Controls"). How can I do if I want my measure1 for line and I don't want modify my pivot table?
    Thank you very much!

    Ok, I'll explain my problem again. In my pivot table I add graph vision and I want in the same view (Pivot table). My graph is "Line Bar Combo" and I don't know how but the last of my measures belongs to right AXIS, if I change order of my measures I can see in my graph the measure that I want in my right axis BUT also it changes the order of my pivot table.
    This is my problem. I think that I can do that with different views but I lose my selector view to view graphic and my pivot table at the same time.

  • Problem with truncate table in procedure ora -00054

    hi do anybody know where is mistake ???
    the procedure has problem with truncate table
    ora - 00054: resource busy and acquire with NOWAIT specified
    ora - 06512 at "POVAPSYS.HMAN_P_REFRESH", line 6
    ora - 06512 at "POVAPSYS.POVAPSYS", line 6
    ora - 06512 at line 1
    this is my procedure....
    AS
    BEGIN
    execute immediate 'TRUNCATE TABLE hman_t_max';
    INSERT INTO hman_t_max SELECT * FROM hman_v_max;
    COMMIT;
    END;

    2.MAKE SURE THAT OTHER THAN YOU ANYBODY IS TRYING TO
    COMPILE AND RUN THE PROCEDUREShould he make sure that anybody is running the procedure?
    3.MAKE SURE THAT ANY PARALLEL QUERY IS RUNNING IN THE
    SERVER SIDE,THATS KEEPS THE RESOURCE BUSYShould he make sure any parallel query is running in the server side to keep the resource busy?
    Gita,
    I COULDN'T RESIST HAVING ONE SUGGESTION FOR YOU. Please look at the impact of your English in the reply before posting. Check if that sends reverse message!
    Cheers
    Sarma.

  • Problem with adding new field to the mass change screen in FBL5N

    Hi,
    We have a problem with adding the field XREF3 to the mass change screen. We followed steps described in the SAP Note 640908, but the result is that when we try to mass change some documents in FBL5N and enter some values in the mass change screen, a message appears: "Please enter at least one new value" and nothing is changed.
    If you have faced with such a problem, we would be grateful if you give us some tips.
    Regards,
    Miłosz Włodarczyk

    The problem has been resolved: we didn't activate a code in SE80.

  • Problem with the table control BDC in FV60 transaction

    Hi All,
    I got the problem with the table control in FV60 transaction.
    This is working for 900 line items.After 900 line items it is giving the problem like it is 1000th line item.You can post only 999 line items.
    I know we can post only 999 line items,but in my file only 920 line items.
    Please give me solution,if anybody come across this situation.
    Thanks & regards,
    rakesh.

    Hello Rakesh ,
    your file may have only 920 line items , but based on those line items, SAP may create few more  new lines ( based on the clearing recon accounts , inter company transaction ...etc )...
    regards
    Prabhu

Maybe you are looking for