ASSIGN COMPONENT x OF STRUCTURE not assigning !

Hello,
the problem is that the component PAKET is not getting assigned to my field symbol (<l_str_applparam> type any) and i don't understand why. The PAKET field is type INT4 and the value is 1111.  The importing structure i_str_applparam is also type any.
See coding below:
  DATA: l_sel_tab TYPE TABLE OF rsparams,
              l_rcl_type TYPE REF TO cl_abap_typedescr,
              l_comp_table TYPE abap_component_tab,
              l_rcl_struc TYPE REF TO cl_abap_structdescr,
              l_tab_fields TYPE abap_compdescr_tab.
  m_var_beschreibung = i_var_beschreibung.
  DATA l_var_ddic_header TYPE x030l.
  l_rcl_struc ?= cl_abap_typedescr=>describe_by_data( i_str_applparam ).
  l_var_ddic_header = l_rcl_struc->get_ddic_header( ).
  CREATE DATA m_str_applparam TYPE (l_var_ddic_header-tabname).
  FIELD-SYMBOLS: <l_str_applparam> TYPE ANY.
  GET REFERENCE OF i_str_applparam INTO m_str_applparam.
  LOOP AT l_sel_tab INTO l_wrk_sel
    WHERE kind = 'P'.
    CASE l_wrk_sel-selname.
      WHEN 'PA_PAKET'.
        IF l_wrk_sel-low IS NOT INITIAL.
          ASSIGN COMPONENT 'PAKET' OF STRUCTURE m_str_applparam TO <l_str_applparam>.
          CHECK <l_str_applparam> IS ASSIGNED.  ?? NOT ASSIGNED ??
          <l_str_applparam> = l_wrk_sel-low.
        ENDIF.
    ENDCASE.
Thank you in advance,
Ioan Constantin.

Hello Uwe,
thank you for the first answer. I have another tiny question: i am not allowed to change the values of the import structure and i want to save them in my class, is there a simpler way to save the data besides the loop below ??
  DATA: l_var_ddic_header TYPE x030l.
  l_rcl_struc ?= cl_abap_typedescr=>describe_by_data( i_str_applparam ).
  l_var_ddic_header = l_rcl_struc->get_ddic_header( ).
  CREATE DATA m_str_applparam TYPE (l_var_ddic_header-tabname).
  FIELD-SYMBOLS: <l_str_applparam> TYPE ANY,
                 <l_str_m_applparam> TYPE ANY,
                 <l_var_comp> TYPE ANY,
                 <l_var_m_comp> TYPE ANY.
  ASSIGN i_str_applparam to <l_str_applparam>.
  ASSIGN m_str_applparam->* TO <l_str_m_applparam>. "m_str_applparam is a class attribute
  DATA l_wrk_rcl_struc TYPE abap_compdescr.
  LOOP AT l_rcl_struc->components INTO l_wrk_rcl_struc.
    ASSIGN COMPONENT l_wrk_rcl_struc-name OF STRUCTURE <l_str_applparam> TO <l_var_comp>.
    ASSIGN COMPONENT l_wrk_rcl_struc-name OF STRUCTURE <l_str_m_applparam> TO <l_var_m_comp>.
  <l_var_m_comp> = <l_var_comp>.
  ENDLOOP.
Regards,
Ioan.

Similar Messages

  • Assign Component with dynamic structure.

    Hi,
    I like to get a field from a structure which i read from a customizing table. I think with a snippet it is easy to understand:
      FIELD-SYMBOLS:  <fs_value>         TYPE  Any.
    DATA: lv_field type text30,
           lv_structure type  but000,
           lv_Structure_name type text30.
    select single *
      into lv_structure
      from but000.
    lv_field = 'PARTNER'.
    lv_Structure_name = 'LV_STRUCTURE'.
    ASSIGN COMPONENT lv_field OF STRUCTURE lv_Structure_name TO <fs_value>.
    But this doesn't wok, because it seems, that this statement try to get the fieldname from the variable 'lv_Structure_name'.
    If i replace lv_Structure_name with lv_Structure than it works, but this is not what I like.
    Any ideas
    Stefan

    Hi,
    with a little addition of a second fs:
    FIELD-SYMBOLS: <fs_value> TYPE ANY.
    FIELD-SYMBOLS: <fs_struc> TYPE ANY.
    DATA: lv_field TYPE text30,
    lv_structure TYPE but000,
    lv_structure_name TYPE text30.
    SELECT SINGLE *
    INTO lv_structure
    FROM but000.
    lv_field = 'PARTNER'.
    lv_structure_name = 'LV_STRUCTURE'.
    ASSIGN (lv_structure_name) TO <fs_struc>.
    ASSIGN COMPONENT lv_field OF STRUCTURE <fs_struc> TO <fs_value>.
    it will work.
    regards
    Jörg

  • Question to ASSIGN COMPONENT 3 OF STRUCTURE LFC1 TO FS .

    Hi,
    i do this in abap (ECC6):
    FIELD-SYMBOLS: <FS> TYPE ANY.
    ASSIGN COMPONENT 3 OF STRUCTURE LFC1 TO <FS>.
    WRITE: / <FS>.
    it works as i need.
    Is it possible to get the fieldname of the 3. field of structure LFC1?
    thanks.
    regards, Dieter

    Hi,
    You can via a couple of method calls....
    report  zdescribe.
    data: gs_t001 type t001.
    data: go_struct type ref to cl_abap_structdescr,
          gt_comp   type abap_component_tab,
          gs_comp   type abap_componentdescr.
    start-of-selection.
      go_struct ?= cl_abap_typedescr=>describe_by_data( gs_t001 ).
      gt_comp = go_struct->get_components( ).
      loop at gt_comp into gs_comp.
        write: / gs_comp-name.
      endloop.
    Darren

  • Assign values to bapi structure dynamically

    Hi,
    I have to use the BAPI, BAPI_MATERIAL_SAVEDATA to extend the material to different plant specific views. I have to use the structure BAPI_MARC and other structures in order to do this. But the values to be passed to the structure BAPI_MARC are not fixed. These values will be maintained in a custom table against the structure name and field name for a particular plant.
    In the program I have to extract the structure name and field name for a corresponding plant from custom table and fill the corresponding value in BAPI structure BAPI_MARC.
    Now, internal table in the program is having these details.
    How can I fill the bapi structure BAPI_MARC based on this information.
    For example, if in custom table, value 0001 is maintained against the field PUR_GROUP, I have to fill the field PUR_GROUP in strcutre BAPI_MARC with 0001.
    Hope I am clear in explaining the problem. Please let me know how to aciheve this?
    Best Regards,
    Kumar.

    Hi,
    I have tried to implement that in a sample program first. Please have a look at the code below.
    DATA: BEGIN OF line,
            col1 TYPE i,
            col2 TYPE i,
            col3 TYPE i,
          END OF line.
    DATA comp(4) TYPE c VALUE 'COL3'.
    FIELD-SYMBOLS: <f1> TYPE ANY, <f3> TYPE ANY.
    ASSIGN line TO <f1>.
    ASSIGN COMPONENT comp OF STRUCTURE <f1> TO <f3>.
    IF <f3> IS ASSIGNED.
    ENDIF.
    I checked in the debugging mode and the value of <f3> in debugging mode is 0, but not line-col3.
    Best Regards,
    Kumar

  • CO-PC Cost components are not assigned when actual cost was posted

    Hi Expert,
    I estimate material cost by Tcode CK11N, the result is cost components were assigned to plan cost. It's okay. But, I have a problem when posting actual cost.
    After actual cost was posted by confirming backflush, I run Tcode KKBC_PKO to check again, but Cost Component field is not assigned to actual cost.
    Please tell me the reason.
    Regard,

    Hi,
    Thank for your answer.
    I will check Cost component Structure, and ensure that all cost elements were assigned.
    Additional, cost components were assigned to PLAN cost, but not assigned to ACTUAL cost.
    Do I have to configure something more?
    Regard,

  • Runtime error "field symbol not assigned"

    hi friends i have designed a report in alv form. and there is one runtime error afer user selectin screen.
    "field symbol has not been yet assigned"
    what could be the problem

    Please check the field catalog you have created
    ls_fieldcatalog-tabname = 'GT_FINAL'.
      ls_fieldcatalog-fieldname ='PSPNR'.
    *  ls_fieldcatalog-coltext = text-001.
      ls_fieldcatalog-col_pos = 1.
    *  ls_fieldcatalog-do_sum = 'X'.
    *  ls_fieldcatalog-outputlen = 20.
      APPEND ls_fieldcatalog TO  gt_fieldcatalog.
      CLEAR ls_fieldcatalog.
    or if you are using filed symbols than
    ASSIGN COMPONENT 'GTFINAL' OF STRUCTURE gt_final
    thanks

  • ASSIGN Component ... (field symbol stuff)

    Hi,
    I want to validate certain fields (KNA1, BUKRS, KOART, FNAME) which are
    entered by the user in the transaction XK01.  They are being captured in a structure, lets say X_LFA1.
    To validate this fields I am being asked to use field symbols using component assign.
    Can someone tell me how do I do this ?

    Tushar,
    Its still not clear to me what exactly you are trying to do.
    Is it like you just want to see if those fields exist in the table or not? If yes, you can do like this.
    parameter : p_field -- field entered by the user
    data : wa_ztable like ztable.
    field-symbols : <fs_any> type any.
    Assign component p_field of structure wa_ztable to <fs_any>.
    if sy-subrc = 0.
    Success.
    endif.
    Regards,
    Ravi

  • Field-symbol not assigned

    Hello,
    I speak only a bit so I wait that you can understandme.
    I have a field-symbol that is assigned to a component of a structure but when I use the field-symbol I recived a error message that say me "field-symbol is not assigned".
    field-symbols <ubi> type any.
    campo = 'UBIORI'.
    assign component campo of structure
                          t_cuantos to <ubi>.
    Thank you very much.

    H,
    Put a check as follows:-
    field-symbols <ubi> type any.
    campo = 'UBIORI'.
    assign component campo of structure
    t_cuantos to <ubi>.
    if <ubi> is assigned.
    * do further processing here
    endif.
    How is the structure t_cuantos defined?
    Is it having a field named UBIORI?
    t_cuantos should be a workarea(structure) and not an internal table.
    Check the points and reply.
    Regards,
    Ankur Parab

  • Field Symbol not assigned  error

    Hello all...
    I am a functional BI guy but having some problems with some BPS exit code (in charisteristic relationships) ...
    any idea why I would get a 'field symbol not assigned' error with the below?
    The code is straight out of How to: Lines Items in BPS
    Short dump says: GETWA_NOT_ASSIGNED
    Thanks all
    *"*"Local interface:
    *"  IMPORTING
    *"     VALUE(I_AREA) TYPE  UPC_Y_AREA
    *"     REFERENCE(ITO_CHA) TYPE  UPC_YTO_CHA
    *"  CHANGING
    *"     REFERENCE(XS_CHAS) TYPE  ANY
    *"  EXCEPTIONS
    *"      FAILED
    FIELD-SYMBOLS: <l_chavl> TYPE ANY.
    * fill ID
    ASSIGN COMPONENT 'zbpsguid' OF STRUCTURE xs_chas
    TO <l_chavl>.
    CALL FUNCTION 'GUID_CREATE'
    IMPORTING
    ev_guid_32 = <l_chavl>.
    * fill user
    ASSIGN COMPONENT '0UNAME' OF STRUCTURE xs_chas
    TO <l_chavl>.
    <l_chavl> = sy-uname.
    * fill date
    ASSIGN COMPONENT '0DATE' OF STRUCTURE xs_chas
    TO <l_chavl>.
    <l_chavl> = sy-datlo.
    * fill time
    ASSIGN COMPONENT '0TIME' OF STRUCTURE xs_chas
    TO <l_chavl>.
    get time field <l_chavl>.
    ENDFUNCTION.

    i just figured it out when you sent me your reply...
    it works!
    genius!

  • Help - assign component

    Hi,
    i need your ideas for an assign component issue.
    data definition:
    *table
    it1_tab: (all fields are char1: field1, field2, ...field99)
    *local fields
    lv_fieldx1 type string.
    lv_fieldx2 type string.
    lv_fieldx99 type string.
    Now i need to check "field1 of table with localfield1" and "field2 of table with localfield2"  ...until field99).
    Example with IF step.
    if it_tab-field1 = 'X'.
    lv_fieldx1 = '1'.
    else.
    lv_fieldx1 = '0'.
    endif.
    if it_tab-field2 = 'X'.
    lv_fieldx2 = '1'.
    else.
    lv_fieldx2 = '0'.
    endif.
    if it_tab-field99 = 'X'.
    lv_fieldx99 = '1'.
    else.
    lv_fieldx99 = '0'.
    endif.
    I think there is a better way by using assign component in a Do step ?
    any ideas ?
    Regards,
    Gordon

    something like (may contain errors):
    DATA : lv_index(2) TYPE n.
    DATA : lv_fieldname1 TYPE fieldname.
    DATA : lv_fieldname2 TYPE fieldname.
    FIELD-SYMBOLS : <lv_field1> TYPE ANY.
    FIELD-SYMBOLS : <lv_field2> TYPE ANY.
    LOOP AT itab.
    DO 99 TIMES.
    lv_index = sy-index.
    CONCATENATE 'FIELD' lv_index INTO lv_fieldname1.
    CONCATENATE 'LV_FIELDX' lv_index INTO lv_fieldname2
    ASSIGN COMPONENT (lv_fieldname1) OF STRUCTURE itab TO <lv_field>.
    ASSIGN (lv_fieldname2) TO <lv_field2>.
    IF <lv_field1> IS NOT ASSIGNED OR
    <lv_field2> IS NOT ASSIGNED.
    CONTINUE.
    ENDIF.
    IF <lv_field> EQ 'X'.
    <lv_field2> = 'X'.
    ELSE.
    <lv_field2> = ' '.
    ENDIF.
    ENDDO.
    ENDLOOP.
    There will be definetly one more problem: The genrated field names will look like this: field01, field02, field03... There are two solutions: 1. You change the declaration accordingly 2. You cut the leading zeros from lv_index

  • Please explain,  the job of the  "ASSIGN COMPONENT ".

    Please read this popular example appended below. I am newbie to ABAP.
    At the end of the execution the code is printing 33. Don't get it.
    Please explain,  the job of the  "ASSIGN COMPONENT ". How or why it is printing value 33.  What is the meaning of the statement, "ASSIGN COMPONENT <F2> OF STRUCTURE <F1> TO <F3>." ?
    DATA: BEGIN OF LINE,
    COL1 TYPE I VALUE '11',
    COL2 TYPE I VALUE '22',
    COL3 TYPE I VALUE '33',
    END OF LINE.
    DATA COMP(5) VALUE 'COL3'.
    FIELD-SYMBOLS: <F1>, <F2>, <F3>.
    ASSIGN LINE TO <F1>.
    ASSIGN COMP TO <F2>.
    DO 3 TIMES.
    ASSIGN COMPONENT SY-INDEX OF STRUCTURE <F1> TO <F3>.
    WRITE <F3>.
    ENDDO.
    ASSIGN COMPONENT <F2> OF STRUCTURE <F1> TO <F3>.
    WRITE / <F3>.
    11 22 33
    33

    DATA: BEGIN OF LINE,
    COL1 TYPE I VALUE '11',
    COL2 TYPE I VALUE '22',
    COL3 TYPE I VALUE '33',
    END OF LINE.
    DATA COMP(5) VALUE 'COL3'.
    FIELD-SYMBOLS: <F1>, <F2>, <F3>.
    ASSIGN LINE TO <F1>.
    ASSIGN COMP TO <F2>.      "here you are assigning the column name which is COL3 to <f2>.
    DO 3 TIMES.
    ASSIGN COMPONENT SY-INDEX OF STRUCTURE <F1> TO <F3>.
    WRITE <F3>.
    ENDDO.
    ASSIGN COMPONENT <F2> OF STRUCTURE <F1> TO <F3>.
    ASSIGN 'COL3' of structure <f1> to <f3>. "it is equal to above statement.
    WRITE / <F3>.
    11 22 33
    33
    ASSIGN COMPONENT <F2> OF STRUCTURE <F1> TO <F3>. means
    assigining  COL3  value of the structure <f1> to <f3>, so value is 33 , it will be assigned to <f3> .it prints 33.

  • Cost element is not assigned to cost component structure

    Dear Team,
    While doing the settlemnt through KO88 system is showing the message like below
    Cost element 433001 is not assigned to a cost component in CostCompStruct Z1
         Message no. MLCCS 010
    Diagnosis
         You have activated the actual cost component split.
         No cost component has been assigned to cost element 433001 origin group
         in cost component structure Z1 for chart of accounts XXX. The system is
         unable to assign the value to a cost component.
    System Response
         You cannot carry out posting.
    Procedure
         Check whether for this operation the value to be posted is to be
         assigned to this cost element.
    User has done tchnically completed from CO side .But system is showing the open status in FI.
    So we have suggested to the user to do settlemt through KO88 system is showing the above message .Half of the production orders we can able to close through Ko88. Some of the PO we are facing the above issue.The concern GL account showing by the system is maintained as a sundry receivables a/c.
    Please advice how to proceed further.
    Thanks for the consideration.
    Regards,
    Suma

    Dear Sir,
    System is showing the GL account  is not relating the cost element a/c ,The concern account belongs to Sundry receivables account.
    The configuration is done correctly with  all expenses GL a/c in OKTZ as well WIP accounts assigned corrctly in  OKG8.                How the system is showing this account which i am not understanding.
    Please advice to resolve.
    Thanks for the consideration.
    Regards,
    Suma

  • Cost element 7000218 is not assigned to a cost component in CostCompStruct

    Dear All,
    How to change the standard price in MR21 for materials with Price Determination Control 3 ( header level V & 3) (Split level S & 3)
    In MR21, when I am updating the price for initial stock uploading.
    It throws me a error Cost element 7000218 is not assigned to a cost component in CostComp Struct 01
    Actually the cost component structure 01 is not active. we are using OP cost component structure & it is active , further the  assigned to  the company code level.
    Cost element 7000218 is assigned to the cost component structure OP.
    please suggest why it result in above error, even though we are not using cost component structure 01.
    Regards
    Subbu.

    Hi,
    Did you change the cost component structure assignment for the plant ?
    This error could be produced due to the fact that for this plant the cost component struture was changed from 01
    But ML tables makes reference to the old cost component structure.
    You can check table CKMLKEV.
    During the creation of the material the system creates data for the current, previous and last period of the last year (12 2010).
    Therefore the system tries/ needs to create also a cost componet split for the period 12 2010. For this it must used the cost component structure for this period 12 2010 (maybe 01).
    In such a case you have to define the cost element in '01' as well.
    Please do read note 434873 carefully for the side effect and correct procedure to change cost component structure.
    regards
    Waman

  • Deep structure - assign component

    hi,
    I have a structure like:
    data: begin of wa_xxx,
            rec like bkpf,
            iba(10) TYPE c,
            bba(10) TYPE c,
          END OF wa_xxx.
    Now I would like to assign the strucutre like:
    field-symbols: <fs_1> like wa_xxx
    loop....
    assign component sy-tabix of structure <fs_1> to <fs_2>.
    endloop.
    The first compoment is rec, but I need <fs_1>-rec-...(fields of the structure)
    How can I do this? Any Idea?
    thanks
    markus

    Hi Markus,
    I'm not sure exactly what you mean but here's some code:
    types: begin of ty_xxx,                        
            rec like bkpf,                         
            iba(10) TYPE c,                        
            bba(10) TYPE c,                        
          END OF ty_xxx.                           
    data t type table of ty_xxx.                   
    data d type ty_xxx.                            
    field-symbols: <el> type any, <str> type ty_xxx.  
    you can assign the whole structure to a field-symbol...                                               
    loop at t assigning <str>.   
    you can refer                   directly to eleemnets within the filed-symbol structure...
    if <str>-bba is initial. endif.                
    do.         
    you can loop through the individual components of the field symbol structure                                  
    assign component sy-tabix of structure <str> to <el>.  
    if sy-subrc <> 0.                              
    exit.                                          
    endif.  
    you can operate on the current element within the structure
    if <el> is initial. endif.                                                                               
    enddo.                                                                               
    endloop.

  • CK11N alert:"Costing item 00001 is not assigned to a cost component"

    Hi,
         When I use CK11N, fill in all the necessary field, there will appear a alert.
          The detail as follows:
    Costing item 00001 is not assigned to a cost component
    Message no. CK 334
    Diagnosis
    No cost component is assigned to costing item 00001.
    System Response
    The costs for the costing item are not shown.
    Procedure
    Go into Customizing for Product Cost Controlling and check the assignment of cost elements to cost components.
           I have used KA03,KL03,CR03 to checked previous datas, but I find no errors?
    What is the problem?

    Hi,
    Use OKTZ to create cost component structure.
    Check for some of these settings also
    Configuration:
    Define costing sheets
    OKTZ create cost component structure
    OKK4 Define valuation variant
    OKKN Define cost variant
    Master Data:
    KP26 setup activity rates
    CR01 setup work centers
    MM01 setup material masters
    CS01 setup Bill of Materials
    CA01 setup routings
    Regards,
    Murali

Maybe you are looking for

  • Fields Missing in datasource

    Hi friends,           Please help, I have some fields missing in my data source , but they are available in the extract structure of that data source..what do I do now, to see the same fields in my data source also?? should I ahve to append the data

  • My iphone 4s is running VERY slow

    I thought my phone was ok... UNTIL I bought my wife a new 4s... and it blows mine away on speed... why???

  • GRC upgrade to 530_46C taking in account CUA

    Hello Guru, I am actually running GRC 400_46C and we need to upgrade it to 530_46C. I have been able to find a nice upgrade documentation on service.sap.com; however, I still have a question for you. I have a CUA installed on my landscape and I was w

  • Evaluation path for team calender in MSS

    Hi Experts, I need to configure an evaluation path as follows. 1.  A manager  M1 belongs to org unit O1. He manages Org unit O2. 2.  Org unit O2 reports to O1. similarly O3 also reports to O1. 3.  Now I need to develop a evaluation path in which, M1

  • HOST UNREACHABLE - two network cards

    We have two ethernet cards. The first has a static IP address. This is the card that is used for our internal network. The second card recieves a dynamic IP address from a DHCP server. The second card is used to connect our machine to the internet. W