Assign component

Hi,
I'm trying to compare 2 internal tables to match any mis matches and it works. Now i want to get the original field name and write that infront of the data..
For example now i can get   
3000150     6000150  mismatch
But i want to get the field name infront of the data, for example
Sales order       3000150     6000150  mismatch
ASSIGN COMPONENT SY-INDEX OF STRUCTURE ITAB_OD_HEADER TO <FS1>.
Can you tell me how to get the table field name it reads, not the index ?
Thanks
Keshi

Hi,
If you want to compare two internal tables and to extract differences, do like this:
Down load two internal tables into two different text files usin GUI_DOWNLOAD.
And then compare these two files using the DOS command comp.
i.e, COMP file1.txt file2.txt /a >> file3.txt.
This is the option list for compare command:
COMP [data1] [data2] [/D] [/A] [/L] [/N=number] [/C] [/OFF[LINE]]
  data1      Specifies location and name(s) of first file(s) to compare.
  data2      Specifies location and name(s) of second files to compare.
  /D         Displays differences in decimal format.
  /A         Displays differences in ASCII characters.
  /L         Displays line numbers for differences.
  /N=number  Compares only the first specified number of lines in each file.
  /C         Disregards case of ASCII letters when comparing files.
  /OFF[LINE] Do not skip files with offline attribute set.
To compare sets of files, use wildcards in data1 and data2 parameters.
Reward if helpful
Regards,
Sandhya.M

Similar Messages

  • 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.

  • 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.

  • 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.

  • 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

  • BAPI For CA02 - Assign Component allocation for routing

    Hello Gurus,
    I m searching for the bapi for the component allocation in routing.
    Since  routing is already created my work is to assign component allocation to the operation.
    i tried with the BAPI_ROUTING_CREATE  and /SAPMP/BAPI_ROUTING_PROCESS
    BAPI_ROUTING_CREATE can be used only to create new routing.
    But the /SAPMP/BAPI_ROUTING_PROCESS is going to short dump.
    So any alternate please suggest.
    Please provide sample code to assign component allocation.

    Please have a look at following thread:
    http://scn.sap.com/thread/2084329
    Also,check tcode :CWBQM
    Regards

  • Unable to bring up expression editor for Assign component 's source node

    Hi All,
    I am a beginner in BPEL and trying to create a simple hello world BPEL process in my JDev 11.1.1.5.0
    The screenshots in external tutorial does not match the Assign component window.
    I started a new asynchronous SOA BPEL composite and then dragged an assign component in the middle of the recieveInput and callbackClient. Now I double clicked the Assign1 icon and get the "copy Rules" tab but I do not see any LOV in the top left which would have "expression" as a value as I want to concatenate the input string with "hello". I see a "Fx Calculator Icon" which I am supposed to drag to the target node but I can not drag it to the input node. Isn't possible to write an expression to the source node ?

    Hi,
    the assign activity changes a little bit between the versions of the JDeveloper. But we can figure it out, if you want to concatenate the input variable element and assign to the element of Output variable, what you can do is, drop an expression builder on the element of the output variable; then inside that expression builder you can use concat xpath function.
    I beleieve in 11.1.1.3 version, if you want to append and assign to a target variable; we need to drop an assign activity, select copy operation; then select the expression as Type and write the concat expression in that window and on the right hand side, we need to select the variable for whome you want to assign the concatanated value.
    Hope this helps,
    N

  • 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

  • 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

  • Assign component in loop

    HI  All
    I doing the following loop and the table it_mapping can be with lot of records
    There is a way that i can do the loop for just the relevant field (something that similar to LOOP and Where )
    since for instance table ls_mapping can be with 10000 records and in structure <ls_attributes> i have just
    2 fields that are the same (the loop run dynamically since  <ls_attributes> can be differnt in every run of the program )
    LOOP AT it_mapping INTO ls_mapping.
        ASSIGN COMPONENT ls_mapping-target_field OF STRUCTURE <ls_attributes>
        TO <lo_attr>.
        IF sy-subrc = 0.
          <lo_attr> = ls_mapping-field_value.
        ENDIF.
      ENDLOOP.
    Regards
    Alex

    Hi friend,
    here ls_mapping contains fields same fields are available to <ls_attributes> fieldsymbol
    then only when pass the value to <lo_attr> then automattically value comes then u can insert into the internal table that must declare as fieldsymbol.
    TYPES:BEGIN OF TY_MAPPING,
    FLD1 TYPE STRING,
    VAL TYPE STRING,
    END OF TY_MAPPING.
    DATA:LS_MAPPING TYPE TY_MAPPING,
    IT_MAPPING TYPE STANDARD TABLE OF TY_MAPPING.
    FIELD-SYMBOLS:<LT_ATTRIBUTES> TYPE STANDARD TYPE OF (LS_MAPPING).
    ASSIGN LT_ATTRIBUTES ->* <LS_ATTRIBUTES>.
    LOOP AT it_mapping INTO ls_mapping.
        ASSIGN COMPONENT ls_mapping-target_field OF STRUCTURE <ls_attributes>
        TO <lo_attr>.
        IF sy-subrc = 0.
          <lo_attr> = ls_mapping-field_value.
    APPEND <LS_ATTRIBUTES> TO <LT_ATTRIBUTES>.
        ENDIF.
      ENDLOOP.
    I think it will be excuted.
    thanks&regards.
    murali

  • Assign component - dynamic field

    Hey experts,
    I want to do this:
    ASSIGN COMPONENT (wa_dd08l-fieldname) of structure  <wa_deleted> to <ls_id>
    but the (wa_dd08l-fieldname) is incorrect, I can't put there those parentheses.
    The <wa_deleted> is a dynamic field symbol and I need to get the ID from it, I have the fieldname of the ID in wa_dd08l-fieldname, but
    I can't use it in ASSIGN COMPONENT, so how could I get the value of the fieldname (wa_dd08l-fieldname) from <wa_deleted>?
    Regards,
    Robert    

    Why do you want to use the parenthesis?
    ASSIGN COMPONENT (wa_dd08l-fieldname) of structure  <wa_deleted> to <ls_id>
    ASSIGN COMPONENT wa_dd08l-fieldname of structure  <wa_deleted> to <ls_id>
    Max

  • Problem with EL evalulation when used to assign component ID in ui:repeat

    Hello everyone,
    I've a problem when I try to assign the ID of a component with an EL within an ui:repeat component, e.g.:
    0 <ui:repeat value="#{dm.categories}" var="category">
    1      <rich:panel id="catPanel#{category.id}">
    2         ....
    3       </rich:panel>
    4       <someohtertag someatt="catPanel#{category.id}" />
    5  </ui:repeat>The above page renders correctly but the id in line 1 evaluates to ...catPanel in HTML. The other tag evaluates of course correctly to catPanel123.
    When I use an EL variable from outside of the repeat tag it evaluates.
    Am I doing something wrong here or are the ID attributes evaluated in a different rendering pass?
    Does anyone have another idea how to assign the IDs in such a manner?
    ciao,
    Elmar

    Hi,
    Check in t.code CMOD whether project is active or not (Activate the Project)
    BR,
    Vijay

  • Assign component / batch number at subcon PO

    hi,
    We are using external batch number assignment to manage our components. At component overview of subcon PO, we will maintain the issue storage location and batch number of the component. However, we fount out error meesage ME178
    , batch XXX not maintained for material XXX, will pop up if the batch master hasn't been created at that storage location. This has impacted on our biz process. That means we can't assign batch and storage location before we transfer the stock to that storage location. I tried to switch this system message to warning. But I can't locate it. Any input? Thanks.
    Regards,
    Nancy

    Hi Nancy,
    Use transaction "SE91" to check the message. In your case the message class appears to be ME, so enter ME and go for display. Now you would get all the messages setup for the class ME.
    Find message number 178 and hit where used button, it would list in which program/include this message is called.  There you define it as "W" instead of "E".
    Hope this helps you,
    Regards,
    Prasobh
    Reward your points if this was useful

  • Assign component link to UI Framework

    Hi,
    I created a zcomponent and now I need to add this component as a link to UI Framework usder reports.
    Could anyone please explain me the steps what i need to do to.
    Regards,
    Kamesh Bathla

    please post the error from the error log

Maybe you are looking for

  • Creation of a public table in oracle 10g

    Hey Guys, I got stcuk while creating a public table which allow all users on the system to access and tried to implement the concept of ownership and previleges but got the following error: ORA-02421: missing or invalid schema authorization identifie

  • Cleared items reversal automatically

    Hi Experts This is regarding mass reversal of cleared items that can be done in T.code FBRA Can anyone tell me how to do mass reversal of cleared items automatically. Is there any BAPI is existing for for automatic reversal of cleared items. Thanks B

  • Payment term from Ship-to party

    Hi, Noramlly, Payment trem flows from Sold to praty to the sales orders. My client wants ship- to party wise payment terms should flow to SO since the Purchase order is recevied from ship-to location, still payment is received from the sold-to party

  • How to save photos in a zip file in ios7

    My wife's ipad2 is running ios 7. She has zip files in her email containing photos.  Clicking on the zip file in Mail opens the photos.  Is this being done outside the Mail app? Anyway, we want to save the photos to a photo roll in the Photo app.  Ho

  • Gray color alerts

    Hi, I've alerts with gray color. For example, At the Solution Manager (4.0 Stack 9) this three alert is at gray color( CPU_Utilization, Page_In, Page_Out). Investigating it, I've logged at the satellite system ( BW 3.5, BASIS 6.40) at rz20 transactio