Treat work area text as a field reference

Hi All,
I have trying to do some different type of coding but i dont is there any provision abap for the same so i sharing this with all of you to help in this ;
I m working of Working Clearance Management in which there are number of different customize catalog codes like 'H001' , 'R001' etc.
Whatever the codes user select and then print relevant mapped checkbox displays as selected.
Now on the runtime i want to code so that it can communicate with checkbox e.g  ZCAT_CODE-H002 = '1'.
Now my query is i picks the code on runtime in the internal table and when i loop this internal table using work area it comes in the form of suppose
wa_catalog-code = 'H002', it means user has selected this code.
Now what i want to do is  'H002' i want to use this text as the reference field of structure like  ZCAT_CODE-H002 because i had already defined the structure fields with the name of codes.
I want to use this because i want to get rid of using when statement or if statement.
Please help me how we can achieve it.
Thanks in advance.
Regards,
Deepak kansal.

Hi Deepak .
It is possible .
change the structure of the internal table .Add one more column to internal table of the type (structure of ZCAT_CODE ). Lets say the new added column is "col1" . For all the entries of the internal table you can assign the col1  = ZCAT_CODE .
you can access the details  like this :
wa_code-col1-text  .

Similar Messages

  • How to assign values to a work area which is a Field Symbol?

    Hello Experts!
    I really need your help! this is the problem:
    I need to assign values to fields into a work area which is a field symbol. The values come from a flat file I uploaded and as I can't know the length I had to build the structure dynamically ( That's why I'm using FS). Each field comes from the file separated by ';', I tried using the SPLIT sentence:
    "SPLIT text AT ';' INTO TABLE <dyn_table>." but the values are assigned vertically into the same field instead of horizontally into each field of the table(field-symbol table).
    I know the name of the field dynamically
    (a TEXT + number) and I know I can't do this
    <dyn_wa>-TEXT1 or field_name = 'TEXT1' <dyn_wa>-(field_name).... ohhh I'm blocked, I don't seem to find the answer, please help!
    Thanks in advance!!
    Frinee

    Now that you have a table with the values, you can move them to the work area.
    data: begin of wa,
          fld1(20) type c,
          fld2(20) type c,
          fld3(20) type c,
    *     and so on
          end of wa.
    data: istr type table of string with header line.
    field-symbols: <fs>.
    split text at ';' into table istr.
    loop at istr.
    assign component sy-tabix of structure wa to <fs>.
    if sy-subrc <> 0.
    exit.
    endif.
    <fs> = istr.
    endloop.
    write:/ wa-fld1, wa-fld2, wa-fld3.
    Now, WA has the values in a horizontal fashion.
    Regards,
    Rich Heilman

  • How to fill Dynamic work area or field symbol?

    HI All,
    I have created dynamic work area(field symbol) by using following code. Now I want to fill the work area with values which are there in other internal table.
    * Create dynamic internal table/structure
      call method cl_alv_table_create=>create_dynamic_table
        exporting
          it_fieldcatalog = it_fieldcat
        importing
          ep_table        = dyn_table.
      assign dyn_table->* to <fs_table>.
    * Create dynamic work area and assign to Field Symbol
      create data dyn_line like line of <fs_table>.
      assign dyn_line->* to <fs_wa>.
    My <FS_WA> contains:
    ROW1
    ROW2
    ROW3
    ROW4 as fields in it without having any data.
    I have other internal table.. where I have FIELDS and Data like following:
    FIELD1  FIELD2   FIELD3
    ID1 ROW1 A1
    ID1 ROW2 A2
    ID1 ROW3 A3
    ID1 ROW4 A4
    ID2 ROW1 B1
    ID2 ROW2 B2
    ID2 ROW3 B3
    ID3 ROW1 C4
    Important thing that I have to share with you is... Source table of my Internal table and Source structure to create my dynamic table are same.
    This dynamic table has fields... with "FIELD2" values.
    Thanks,
    Naveen.I

    Create a dynamic internal table
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = lt_fcat
        IMPORTING
          ep_table        = lt_dy_table.
    Create dynamic work area and assign to FS
      ASSIGN lt_dy_table->* TO <fs_dyn_table>.
      CREATE DATA lt_dy_line LIKE LINE OF <fs_dyn_table>.
      ASSIGN lt_dy_line->* TO <fs_dyn_wa>.
    Define WA
      CREATE DATA dref TYPE (iv_struc_name).
      ASSIGN dref->* TO <fs_final>.
    Populate dynamic table from the file
      OPEN DATASET iv_path FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc = 0.
        DO.
          READ DATASET iv_path INTO ls_str.
          IF sy-subrc <> 0.
            ev_failed = abap_true.
            EXIT.
          ENDIF.
          SPLIT ls_str AT ';' INTO TABLE lt_dyn_tab.  " columns
          LOOP AT lt_dyn_tab INTO ls_dyn_tab.
            READ TABLE lt_struc_fld INTO ls_struc_fld INDEX sy-tabix.
            IF sy-subrc EQ 0.
              MOVE ls_struc_fld-fieldname TO ls_fieldname.
              ASSIGN COMPONENT ls_fieldname OF STRUCTURE <fs_dyn_wa> TO <fs_val>.
              IF sy-subrc = 0.
                <fs_val> = ls_dyn_tab.
              ENDIF.
              ASSIGN COMPONENT ls_fieldname OF STRUCTURE <fs_final> TO <fs_val>.
              IF sy-subrc = 0.
                <fs_val> = ls_dyn_tab.
              ENDIF.
            ENDIF.
          ENDLOOP.
          APPEND <fs_dyn_wa> TO <fs_dyn_table>.
          APPEND <fs_final> TO et_table.
          UNASSIGN: <fs_val>.
        ENDDO.
      ENDIF.
      CLOSE DATASET iv_path.

  • Adobe forms: Displaying work area data in different windows

    Hi,
    I have a requirement of showing work area data in different windows i.e work area which has sent from program needs to come in different windows of the form. I have created a smartform which will perfectly doing the above logic. The above work area also contains amount fields. I am also passing language 'English' or 'French', based on this i am displaying some texts also.
    But Client wants to see the same requirement in Adobe forms. Ao i am new to Adobe forms, I need some help for performing the above scenario. I am doing my research on this. But i want to know the steps which will not reduce the performance.
    In smartform, first window contains personnel no from work area and the second window contains address from work area. Then i have created a template with employee premium amount column, company premium amount column and total of that, all these from work area. So work area will contain only one row which i have to show in different window and on template.
    In Adobe forms, How can i do the same this which i have done in smart forms.
    Please suggest me any one in doing this. I appreciate your answers.
    Thanks,
    s.vikgnesh

    Hi,
    Yes as Santoosh said there is no such wiondow option in Adobe forms.
    But if you use webdynpro java/Abap we can acheive this.
    think something like this below, if it works.
    have 2 views 1st for the adobe form, 2nd view in a new window for the work area screen.
    in the adobe view have a button for the work area and respective event handler.
    in the event handler call this window, and then reload the same adobe form.
    if from the work area form if you need value to be passed to this adobe form. have a event handler for this.
    when purpose is done, close that window and set value to the required context field on the form. and reload that adobe form.
    this is a fuzzy process and time consuming, unless business has no other option we dont go this approach.
    but for sure this works, we did the same for a EHS process.
    Cheers,
    Sai

  • Field References, Field Selection Group & Screen Sequence

    Dear Experts,
      Please whare are the importance of field References,  Field Selection group  & Screen Sequence? How do i use them?

    Hi,
    These are Object based (Like Material master, BOM, Routing etc..), so depending on how you want the screen layout and how you want the mandatory/optional field defination you can define it here.
    Regards,
    Prasobh

  • Dynamic field modification in Work Area.

    Hi,
    I want to insert 1 record in a transparent table. (But for time being, let us assume the table is MARA)
    The columns and table name to which data is to be inserted are stored in another transparent table say (z1354_inv_rec_dt).
    The data to be inserted is specified in a text file.
    The value for MATNR, let us assume is hard coded as 1252.
    The value for fields ERSDA, ERNAM, LAEDA and AENAM will be specified in input text file.
    Also the table z1354_inv_rec_dt, will have rows with values ERSDA, ERNAM, LAEDA and AENAM.
    How do I do this, the code specified in form comparedata is not correct one, but just a starting point for code.
    <b>So how do I specify the column of work area at run time and assign value to it.</b>
    Then I have to append value from work area to internal table.
    And from internal table, I will insert to database.
    REPORT ZDYN_INS_MARA.
    TYPE-POOLS : abap.
    DATA:
      lit_z1354_inv_rec_dt  TYPE TABLE OF z1354_inv_rec_dt,
    * table z1354_inv_rec_dt contains 2 columns column_name and table_name
    * values for column_name are ERSDA, ERNAM, LAEDA and AENAM
    * value for table_name is MARA.
      lwa_invoice LIKE  z1354_inv_rec_dt,
      lit_mara TYPE TABLE OF mara,
      lwa_mara LIKE mara.
    * To get column names
    DATA :
      it_details TYPE abap_compdescr_tab,
      wa_details TYPE abap_compdescr,
      ref_descr TYPE REF TO cl_abap_structdescr.
    FIELD-SYMBOLS : <fs_mara> TYPE mara.
    FIELD-SYMBOLS : <fs_wa_mara> LIKE LINE OF lit_mara.
    FIELD-SYMBOLS : <dyn_field>.
    DATA: int_tabname(30).
    int_tabname = 'MARA'.
    *Populate internal table with columns to be added to Database
    PERFORM populaterecdt.
    ref_descr ?= cl_abap_typedescr=>describe_by_name( int_tabname ).
    *Get the column names from the Database tables
    it_details[] = ref_descr->components[].
    PERFORM comparedata.
    *&      Form  PopulateRecDt
    FORM populaterecdt .
      SELECT column_name table_name FROM z1354_inv_rec_dt
      INTO CORRESPONDING FIELDS OF TABLE lit_z1354_inv_rec_dt
      WHERE table_name = 'MARA' .
    ENDFORM.                    " PopulateRecDt
    *&      Form  CompareData
    FORM comparedata .
    *loop through the DB table which holds the column names to be added
    LOOP AT lit_z1354_inv_rec_dt INTO lwa_invoice.
    *Loop throught table which holds the column names
      ASSIGN COMPONENT 'MATNR' OF STRUCTURE <fs_wa_mara> TO <dyn_field>.
      <dyn_field> = '1252'   .
      LOOP AT it_details INTO wa_details.
        IF wa_details-name = lwa_invoice-column_name.
    * Assign value to column of work area from text file.
          ASSIGN component lwa_invoice-column_name of structure                   <fs_wa_mara> to <dyn_field>.
    *Get value for <dyn_field> from text file
            <dyn_field> = 'XYZ212'.
        ENDIF.
      ENDLOOP.
    ENDLOOP.
    *append work area t to lit_mara.
    *Append work area to internal table.
    *insert the internal table to DB
    ENDFORM.                    " CompareData
    Here in this loop, I want to assign to the work area for Mara based on the column values, How do I do it.
    Regards,
    Vikas

    Hi,
    This problem has been resolved.
    DATA:
        lit_MARA TYPE TABLE OF MARA,
        lit2_MARA TYPE TABLE OF MARA,
        lwa_MARA LIKE MARA,
        lit_inv TYPE TABLE OF z1354_inv_rec_dt,
        wa_inv  LIKE z1354_inv_rec_dt,
        sctemp(100) TYPE c,
        ifs type i,
         p_gs_s_rec_line TYPE string.
      FIELD-SYMBOLS:
        <fs_MARA> TYPE table,
        <ld_column>   TYPE ANY,
        <fs_wa_MARA> LIKE LINE OF lit_MARA.
    *Populate Invoice table
      SELECT * FROM  z1354_inv_rec_dt INTO CORRESPONDING FIELDS OF TABLE
      lit_inv WHERE recordtype = 'S' AND table_name = 'MARA' AND
      column_seq > 0.
      p_gs_rec_line = '1234567890000001'.
      lwa_MARA-laufi = '123e'.
      FREE lit_MARA.
      APPEND  lwa_MARA TO lit_MARA.
      ASSIGN lit_MARA[] TO <fs_MARA>.
      UNASSIGN: <fs_wa_MARA>.
    * free lit_MARA[] .
    * LOOP AT <fs> ASSIGNING <fs1>.
    LOOP AT lit_MARA ASSIGNING <fs_wa_MARA>.
      ifs = sy-tabix.
      write: / ifs.
        LOOP AT lit_inv INTO wa_inv.
          WRITE
          p_gs_s_rec_line+wa_inv-start_pos_extrac(wa_inv-chars_to_extract)
          TO sctemp.
          UNASSIGN: <ld_column>.
          ASSIGN COMPONENT wa_inv-column_name OF STRUCTURE <fs_wa_MARA>
          TO <ld_column>.
          <ld_column> =  sctemp.
          IF ( <ld_column> IS ASSIGNED ).
            WRITE: / '.' .
          ENDIF.
          CLEAR wa_inv.
        ENDLOOP.
        MOVE  <fs_wa_MARA> TO lwa_MARA.
        APPEND lwa_MARA TO lit2_MARA.
       CLEAR <fs_wa_MARA>.
      ENDLOOP.
    loop at lit2_MARA into lwa_MARA.
      write: / lwa_MARA-filename.
      clear lwa_MARA.
    endloop.
    insert MARA from table lit2_MARA.
    if sy-subrc <> 0.
      write: / ' Insert  :-( '.
    endif.

  • SOME FIELDS OF WORK AREA ARE CONVERTED TO ***** AT AT NEW STATEMENT

    HELLO
    SOME OF THE FIELDS OF WORK AREA ARE CONVERTED INTO *********** AT AT NEW STATEMENT .FIND BELOW THE CODE
    *& Report  YTEST_OBJECTS7
    REPORT  YTEST_OBJECTS7.
    Program Description
    Author.........: Jitendra Dash                                       *
    Creation date..: 17/09/2010                                                    *
    GAP ID/FS Id...:                                                     *
    Transport......:                                                     *
    Description u2026..:                                                     *
    CHANGE HISTORY u2013 Should be completed in reverse date order           *
    Revised by........: <Developer name>                                 *
    Change date.......: Date of creation>                                *
    CR/Defect No......:  <Change Request No>/ <Defect#<xxx>              *
    Transport.........: <Request No>                                     *
    Description.......: Description about modification                   *
    Data Declaration
    TYPES: BEGIN OF gx_input,
             NEMI      TYPE EXT_UI,
             DIVISION  TYPE SPARTE ,
             DATE      TYPE ERDAT,
             DATE1     TYPE ERDAT,
           END OF gx_input.
    TYPES: BEGIN OF gx_input1,
             NEMI      TYPE EXT_UI,
             DIVISION  TYPE SPARTE ,
             DATE      TYPE ERDAT,
             DATE1     TYPE ERDAT,
             int_ui    TYPE INT_UI,
             ANlage    type   anlage,
             SERVICE   TYPE SERCODE,
             SERVICEID TYPE SERVICE_PROV,
             SPARTE    TYPE SPARTE,
            END OF gx_input1.
    TYPES : BEGIN OF gx_euitrans,
            INT_UI TYPE INT_UI,
            EXT_UI type EXT_UI,
            END OF gx_euitrans.
    TYPES : BEGIN OF gx_eservice,
            INT_UI TYPE INT_UI,
            SERVICE TYPE SERCODE,
            SERVICEID TYPE SERVICE_PROV,
            SPARTE    TYPE SPARTE,
            END OF gx_eservice.
    TYPES : BEGIN OF gx_inst,
            int_ui TYPE INT_UI,
            ANlage type   anlage,
            END OF gx_inst.
    TYPES : BEGIN OF gx_ever,
            ANLAGE TYPE anlage,
            EINZDAT TYPE EINZDAT,
            AUSZDAT TYPE AUSZDAT,
            VERTRAG type VERTRAG,
            vkonto TYPE VKONT_KK,
            END OF gx_ever .
    TYPES : BEGIN OF gx_fkkvkp,
            VKONT type VKONT_KK,
            GPART type GPART_KK,
            END OF gx_fkkvkp.
    DATA : GIT_INPUT TYPE STANDARD TABLE OF GX_INPUT,
           git_euitrans TYPE STANDARD TABLE OF gx_euitrans,
           git_eservice TYPE STANDARD TABLE OF gx_eservice,
           git_inst TYPE STANDARD TABLE OF gx_inst,
           git_ever TYPE STANDARD TABLE OF  gx_ever,
           GIT_INPUT1 TYPE STANDARD TABLE OF GX_INPUT1,
           GIT_fkkvkp TYPE STANDARD TABLE OF GX_fkkvkp,
           WA_INPUT TYPE gx_input,
           wa_euitrans LIKE LINE OF git_euitrans,
           wa_eservice like LINE OF git_eservice,
           WA_inst LIKE LINE OF git_inst,
           wa_ever LIKE LINE OF git_ever,
           wa_INPUT1 like LINE OF git_INPUT1,
           wa_fkkvkp like LINE OF GIT_fkkvkp.
    DATA: gv_v_localfile TYPE localfile,
          gv_g_localfile type string,
          gv_g_alocalfile type string,
          gv_g_sender type SERVICE_PROV,
          gv_g_reciever type SERVICE_PROV.
    CONSTANTS : GC_AINP TYPE c LENGTH 50 VALUE '/tmp'.
    ************Selection screen for input *********************
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE t1.
    PARAMETERS : p_rad1 RADIOBUTTON GROUP grp DEFAULT 'X' USER-COMMAND chk,
                 p_rad2 RADIOBUTTON GROUP grp,
                 p_file TYPE file_table-filename MODIF ID m1,
                 p_afile TYPE file_table-filename MODIF ID m2.
    SELECTION-SCREEN END OF BLOCK b1.
    ***************Initialization*****************************
    INITIALIZATION.
      t1 = text-001.
    ***Selection of Appl ser and Presen ser for I/P file******
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF p_rad1 = 'X'.
          IF screen-group1 = 'M2'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
        ELSEIF p_rad2 = 'X'.
          IF screen-group1 = 'M1'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
      ENDLOOP.
    **F4 help for inputting the Filename from presentation Ser*
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          program_name  = sy-repid
          dynpro_number = sy-dynnr
          field_name    = p_file
        CHANGING
          file_name     = gv_v_localfile
        EXCEPTIONS
          mask_too_long = 1
          OTHERS        = 2.
      IF sy-subrc = 0.
        MOVE gv_v_localfile TO p_file.
        move gv_v_localfile to gv_g_localfile.
      ENDIF.
    ***F4 help for file on Application Server*******************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_afile.
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
        EXPORTING
          directory        = GC_AINP
          filemask         = ' '
        IMPORTING
          serverfile       = p_afile
        EXCEPTIONS
          canceled_by_user = 1
          OTHERS           = 2.
      IF sy-subrc = 0.
        move p_afile to gv_g_alocalfile.
       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    START-OF-SELECTION.
      IF p_rad1 = 'X'.
    *************Upload file into Itab from pres server*********
        CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
             FILENAME                      = gv_g_localfile
      FILETYPE                      = 'ASC'
            HAS_FIELD_SEPARATOR           = '|'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
           TABLES
             DATA_TAB                      = GIT_INPUT
        EXCEPTIONS
          FILE_OPEN_ERROR               = 1
          FILE_READ_ERROR               = 2
          NO_BATCH                      = 3
          GUI_REFUSE_FILETRANSFER       = 4
          INVALID_TYPE                  = 5
          NO_AUTHORITY                  = 6
          UNKNOWN_ERROR                 = 7
          BAD_DATA_FORMAT               = 8
          HEADER_NOT_ALLOWED            = 9
          SEPARATOR_NOT_ALLOWED         = 10
          HEADER_TOO_LONG               = 11
          UNKNOWN_DP_ERROR              = 12
          ACCESS_DENIED                 = 13
          DP_OUT_OF_MEMORY              = 14
          DISK_FULL                     = 15
          DP_TIMEOUT                    = 16
          OTHERS                        = 17
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ELSEIF p_rad2 = 'X'.
    *************Upload file into Itab from Applic server*********
    ************file should be ; seperated and not tab seper******
       TRANSLATE gv_g_alocalfile USING '\/'.
       OPEN DATASET gv_g_alocalfile FOR INPUT MESSAGE gv_LC_MESSAGE in TEXT MODE ENCODING DEFAULT.
       IF sy-subrc = 0.
         DO.
           READ DATASET gv_g_alocalfile INTO wa_xls.
           IF sy-subrc IS NOT INITIAL.
             EXIT.
           ELSE.
             APPEND wa_xls TO git_xls.
           ENDIF.
         ENDDO.
       ENDIF.
       close DATASET gv_g_alocalfile.
      ENDIF.
      SELECT INT_UI EXT_UI from EUITRANS
                           into CORRESPONDING FIELDS OF TABLE git_euitrans
                           for ALL ENTRIES IN  GIT_INPUT
                           WHERE ext_ui = GIT_INPUT-NEMI.
      SElect INT_UI
             SERVICE
             SERVICEID
             SPARTE    from ESERVICE
                       into CORRESPONDING FIELDS OF TABLE git_eservice
                       FOR ALL ENTRIES IN git_euitrans
                       where INT_UI = git_euitrans-INT_UI .
      SELECT INT_UI
             ANLAGE from euiinstln
                    into CORRESPONDING FIELDS OF TABLE GIT_INST
                    FOR ALL ENTRIES IN  git_eservice
                    WHERE INT_UI = git_eservice-INT_UI.
      LOOP AT git_eservice into wa_eservice.
        READ TABLE git_euitrans into wa_euitrans
                                with KEY int_ui = wa_eservice-int_ui.
        IF SY-SUBRC = 0.
          READ TABLE git_input into wa_input
                               WITH key NEMI = wa_euitrans-EXT_UI.
          IF SY-SUBRC = 0.
            READ TABLE  GIT_INST into WA_INST
                                     with key int_ui = wa_eservice-int_ui.
             IF Sy-subrc = 0.
                  wa_input1-NEMI = wa_input-NEMI      .
                  wa_input1-DIVISION = wa_input-DIVISION.
                  wa_input1-DATE = wa_input-DATE.
                  wa_input1-DATE1 = wa_input-DATE1.
                  wa_input1-int_ui = wa_eservice-int_ui.
                  wa_input1-anlage = WA_INST-anlage.
                  wa_input1-SERVICE = wa_eservice-service.
                  wa_input1-SERVICEID = wa_eservice-serviceid.
                  wa_input1-SPARTE  = wa_eservice-sparte.
            Append wa_input1 to git_input1.
             ENDIF.
          ENDIF.
        ENDIF.
        clear : wa_eservice,wa_input,WA_INST,wa_euitrans,wa_input1 .
      ENDLOOP.
      SELECT anlage
             EINZDAT
             AUSZDAT
             VERTRAG
             VKONTO  from ever
                     into CORRESPONDING FIELDS OF TABLE git_ever
                     FOR ALL ENTRIES IN git_input1
                     WHERE anlage = git_input1-ANLAGE
                       and EINZDAT = git_input1-DATE
                       or  AUSZDAT = git_input1-DATE1.
      Select Vkont Gpart from fkkvkp
                         into CORRESPONDING FIELDS OF TABLE git_fkkvkp
                         for ALL ENTRIES IN git_ever
                         where  Vkont = git_ever-Vkonto.
    LOOP AT  git_input1 INTO wa_input1 .
    IF wa_input1-SPARTE = 01  .
    CASE wa_input1-SERVICE.
      WHEN 'FRMP'.
        gv_g_sender = wa_input1-SERVICEID.
      WHEN 'LNSP'.
        gv_g_reciever = wa_input1-SERVICEID.
    ENDCASE.
    ELSEIF wa_input1-SPARTE = 02 .
    CASE wa_input1-SERVICE.
      WHEN 'FRO'.
        gv_g_sender = wa_input1-SERVICEID.
      WHEN 'DB'.
        gv_g_reciever = wa_input1-SERVICEID.
    ENDCASE.
    ENDIF.
    data : int_ui TYPE INT_UI.
    *int_ui = wa_input1-int_ui .
    AT NEW int_ui .
    READ TABLE git_ever into wa_ever with key  anlage = wa_input1-anlage.
    READ TABLE git_fkkvkp INTO wa_fkkvkp with key Vkont = wa_ever-Vkonto.
    CALL FUNCTION 'ZIN_COMEV_CUSTDETAILNOTIF_OUT'
      EXPORTING
        Y_SENDER              = gv_g_sender
        Y_RECEIVER            = gv_g_reciever
        Y_PARTNER             = wa_fkkvkp-gpart
        Y_BASIC_PROCESS       = 'ZCDNO'
      Y_SWITCHNUM           =
      Y_SEN_LOAD            =
        Y_INTUI               = wa_input1-int_ui
      Y_TRANSACTIONID       =
        Y_DATE                = wa_input1-DATE
    IMPORTING
      X_TASK_ID             =
    TABLES
       IDOC_STATUS           =
       IDOC_CONTRL           =
       XYT_ERROR             =
    EXCEPTIONS
      GENERAL_FAULT         = 1
      NOT_FOUND             = 2
      OTHERS                = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDAT.
    ENDLOOP.
    IN THIS PROGRAM AT AT NEW STATEMENT IN LOOP SOME OF THE FIELDS OF wa_input1 IS CONVERTED TO ***** E.G  wa_input1-anlage.
    pLEASE HELP ME OUT

    HELLO
    My Q is some fields at AT NEW statement turns into *****.Please help me out
    TYPES: BEGIN OF gx_input1,
             NEMI      TYPE EXT_UI,
             DIVISION  TYPE SPARTE ,
             DATE      TYPE ERDAT,
             DATE1     TYPE ERDAT,
             int_ui    TYPE INT_UI,
             ANlage    type   anlage,
             SERVICE   TYPE SERCODE,
             SERVICEID TYPE SERVICE_PROV,
             SPARTE    TYPE SPARTE,
            END OF gx_input1.
    GIT_INPUT1 TYPE  gx_input1.
    LOOP AT  git_input1 INTO wa_input1 .
    AT NEW int_ui .----
    >hERE FIELDS OF wa_input1 ARE TURNED INTO *                                                                               
    EX: wa_input1-ANLAGE =******** AFTER AT IN COMMAND.
    END AT
    eNDLOOP

  • Ad hoc query text field reference

    Hi all,
    Faily new to all this and wonder if you have any insight on the following:
    In ad hoc query I'm adding additional fields to a functional area. They subsequently show up in SQ02 in the left hand pane tree structure for that functional area.
    Now, if I double click on one of the additional fields the most central pane shows the details of this field. One of the boxes in there called 'References' contains a field 'Text field' that associates a long text with the code that the field contains.
    As a made-up example: the add. field could be Personnel Area, value "XY01", and it is associated with a field Personnel Area Long Text that contains "Xeta Yoyo Regional Office". This is the association shown in 'References' -> 'Text Field'.
    My problem is that this 'Text field' field seems to be populated automatically, that is there is some kind of automatic link between the field and the foreign field that contains its associated long text. Also it's greyed out so un-editable.
    Does anyone know where this relationship comes from? Does anyone know how to be able to edit this 'Text field' field?
    Grateful for help,
    Richie

    Ok, I'll try to be a bit clearer.
    For infosets in Ad Hoc Query, a field has an option to be related to another, different field that provides the long text version of this. Example: field P1000-OTYPE 'object type' is related to T7770-OTEXT 'object type text'.
    This relationship is displayed for each infoset additional field: right click on the add. field ->  display/change definition, text identification ->  'Determine LIKE reference using text field' in the pop up window.
    Problem is this text field is <b>always</b> greyed out and uneditable. So the question was, how do you set this yourself?
    Hope this clarifies stuff, thanks for any help,
    Richie

  • Work area field value not getting populated in table control grid.

    Hi all,
    I am currently facing an issue where I have declared a variable and have fetched the workarea field name in it. To be exact, the variable contains the workarea name whose value I am finally populating to the table control. Now although the workarea name when manually copied and pasted in field name in debugging mode exhibits the value of the it, Im unable to fetch the same value in the variable as I have only the work area name in it. I need the value of the workarea-field to be in the variable.Please provide your valuable suggestions for this issue...
    Regards,
    Edited by: Vishwanath Sreedharen on Jan 2, 2012 3:25 PM

    Hi Nabheet,
    Please consider the below example...
    DATA: l_var(30) TYPE C.
    CONCATENATE 'wa' '-' I_FIELD2-NAME INTO l_var.
    The i_field2-name contains the name of a custom table field CP_CUSTOM_GRP. So now the l_var contains wa_cp_custom_grp.
    Now consider the wa_cp_custom_grp has a value 'BA'.
    Now my issue is the l_var contains wa_cp_custom_grp but not its value(too obvious)... Would like to know whether is there a way through which the value of this wa_cp_custom_grp  'BA' could be populated to the variable l_var...

  • Custom Field in Work Area of SOCO

    Hi,
    I have to add custom fields in 'CARRY OUT SOURCING-WORK AREA' frame. Is there any standard structure available for this? i know there are standard structures available for shopping cart and others,  but i am not sure whether any structure is available to add custom field in 'CARRY OUT SOURCING-WORK AREA' frame. Please help me in finding out the exact Include structure, which is relevant for my requirement. Also let me know if i have to implement a BADI for this.
    Thanks in Advance,
    Suresh

    Hi Suresh,
    It seems that we are looking for the same answer but i haven't found yet the exact BADI to work with it...
    Here there is some approach:
    In the BBP_SCREENVARIANT BADI there's a method called GET_SCREENVARIANT_SOCO where you can modify the standard screen call from the 0300 dynpro to a 0301 or whatever number dynpro you want to, but the problem it's that i don't know where to generate this new screen and the logic to retrieve the information to fill the new fields that i need....
    So i wish this helps you a lil' bit and if you get something please let me know, i get also a post:
    Can we hide the 'Create Contract' button in SOCO ?
    If you can post any help there i will reward points...
    BR
    Gerardo.

  • Difference between Field symbols and work area for Internal tables

    Hi,
    In ECC versions we all know that we need to declare the internal tables without headerline, and for handling the internal tables we need to use exclusive work areas.
    Currently i have an issue that we have been asked to use field symbols instead of work areas...can any one help me how to use the field symbols and also let me know how it will improve the performance of the program..
    Thanks and Regards,
    Kathir

    Hi
    DATA: WA TYPE ITAB.
    LOOP AT ITAB INTO WA.
    IF WA-FIELD = .....
    ENDIF.
    ENDLOOP.[(code]
    FIELD-SYMBOLS <WA> TYPE ANY.
    LOOP AT ITAB ASSIGNING <WA>.
    ENDLOOP.
    Now the problem is you can't know the name of the fields of the table at runtime, so you can't write:
    IF <WA>-FIELD = .....
    ENDIF.
    Anyway you can create a field-symbols strcturated like the table:
    [code]FIELD-SYMBOLS <WA> TYPE ITAB.
    LOOP AT ITAB ASSIGNING <WA>.
      IF <WA>-FIELD = .....
      ENDIF.
    ENDLOOP.
    I don't know which are the differences for the performance between to use a field-symbol and to use a structure as work-area.
    The differnce between the field-symbols and work-area is the field-symbol is assigned directly to the record, so u don't need to do a MODIFY statament to change something:
    LOOP AT ITAB INTO WA.
      WA-FIELD =
      MODIFY ITAB FROM WA.
    ENDLOOP.
    LOOP AT ITAB ASSIGNING <WA>.
      <WA>-FIELD =
    ENDLOOP.
    These two pieces of abap code do the same action, so probably the field-symbol improve the performance because it do an access directly to the record without to use an external structure as workarea.
    Max

  • Read dynamic field symbol Work Area before append to dynamic table

    Hi experts:
    I have a dynamic work area but before doing an append to the dynamic table, I need to do some validation on some fields of the work area in order to decide to append it or not, but I don't know how...
    More or less this is the example
    loop at so_kschl.
        field = so_kschl-low.
        if <t_dyntable>-field = 0. "if the value of this field in dinamic table is 0.
    don't append
        else.
           APPEND <fs_dyntable> TO <t_dyntable>.  
        endif.
    endloop.
    Thank you very much for your help.
    Miriam

    Check this example, you read the component of the dynamic work area and assign it to a field-symbols. In this case, I validate that the entry is always 'a'.
    DATA: i_lvc TYPE lvc_t_fcat WITH HEADER LINE,
          i_table TYPE REF TO data,
          l_style TYPE lvc_fname,
          l_warea TYPE REF TO data,
          l_name(7) VALUE 'VARCHAR'..
    FIELD-SYMBOLS: <fs> TYPE table,
                  <fs2> TYPE ANY,
                  <fs3> TYPE ANY.
    PARAMETERS p_char TYPE c LOWER CASE.
    START-OF-SELECTION.
      i_lvc-fieldname = 'Varchar'.
      i_lvc-inttype = 'C'.
      i_lvc-intlen = 1.
      APPEND i_lvc.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
      it_fieldcatalog = i_lvc[]
      IMPORTING
      ep_table = i_table
      e_style_fname = l_style.
      ASSIGN i_table->* TO <fs>.
      CREATE DATA l_warea LIKE LINE OF <fs>.
      ASSIGN l_warea->* TO <fs2>.
      <fs2> = p_char.
      ASSIGN COMPONENT l_name OF STRUCTURE <fs2> TO <fs3>.
      IF <fs3> = 'a'.
        WRITE: 'Component VARCHAR is a'.
    *  APPEND <fs2> TO <fs>.
      ELSE.
        WRITE: 'Component VARCHAR is not a'.
      ENDIF.

  • Declaring Field Symbols in a work area

    Hi all!
    I'm triying to learn the use of FieldSymbols, and I wrote in  my code this:
    REPORT  zpractica01.
    Types
    TYPES: BEGIN OF ty_tabla,
            name(25)    TYPE c,
            address(60) TYPE c,
            monto(3)     TYPE p decimals 2,
            END OF ty_tabla.
    Internal Table
    DATA: t_tabla TYPE STANDARD TABLE OF ty_tabla.
    *Work Area
    DATA: vl_variable TYPE c LENGTH 512.
    Field Symbols
    FIELD-SYMBOLS <linea> STRUCTURE st_tabla DEFAULT vl_variable.
    If I try to activate the code I see this error:
    In the Unicode context, the structure <LINEA> typed using STRUCTURE can only contain character-type components (type C,N,D,T).
    I can see that the problem begins when I use a type P inside the structure, but I need to have a type P, so I would like to know how can i use it.
    Could you please teach me how I should declare my field symbols in order to use as an structure with a type P field within a loop at - endloop?
    I'll really appreciate your help.
    Best regards!
    Gaby
    Edited by: gpsoria on Aug 24, 2009 4:30 PM

    Hello Gaby,
    You are getting the error because the structure st_tabla & variable vl_variable are not mutually convertible in a Unicode environment.
    Just change the definition of vl_variable & you code will activate.
    REPORT zpractica01.
    * Types
    TYPES: BEGIN OF ty_tabla,
    name(25) TYPE c,
    address(60) TYPE c,
    monto(3) TYPE p decimals 2,
    END OF ty_tabla.
    * Internal Table
    DATA: t_tabla TYPE STANDARD TABLE OF ty_tabla.
    *Work Area
    DATA: st_tabla TYPE ty_tabla. "--> Add this line
    DATA: vl_variable TYPE ty_tabla. "c LENGTH 512.
    * Field Symbols
    FIELD-SYMBOLS <linea> STRUCTURE st_tabla DEFAULT vl_variable.
    *I will suggest decalre like this:
    FIELD-SYMBOLS <linea1> TYPE ty_tabla.
    Hope i am clear.
    BR,
    Suhas

  • Code to equate table value to work area field name

    Hello Experts,
    How to match a certain value fetched from table to the internal table field.
    For instance: transparent table has a column containing values as
    AMOUNT
    QUANTITY
    there is another work area structure associated with different internal table consisting of amount and quantity fields.
    Now depending on whether the record from transparent table has fetched AMOUNT or QUANTITY, i have to read either the amount or quantity value from the work area.
    Can any one please suggest a technique to do it?
    Thanks,
    Pankaj

    Hi
    Try This:
    suppose you have zitab table as trans. Table and another table itab1 with work area wa.
    First you need to select values from Zitab to an internal table say itab.
    sort itab by <field name>
    loop at itab.
    read table itab1 into wa with key quantity = itab-quantity
                                      amount = itab-amount.
    endloop.
    This will read table itab1 where quantity and amount from itab table matches.
    hope this will work for you.
    thanks
    Lalit Gupta

  • Performance Field Symbols Vs Work Area

    Hi,
    I want to some operations (Validations and Calculations) form each entry of internal table.
    Which is better way to access the data in internal table either using field symbol or using work area?
    I heard that using filed symbols is performance issue. May I know in which cases we should not use field symbols?
    Regards,
    Kumar

    I do not think, the runtime creates a pointer to each line of the itab.
    The developer creates ONE fieldsymbol ( for a loop for example ) --> a pointer, which is iteratively assigned, pointing to only one line at one time.
    With the usage itself it  seems to offer a benefit, which isn't really one, If You only read data.
    People might say, You can omit a clear, if working with fieldsymbols.
    But You have to add a check for sy-subrc, or You will suffer from a dump, which usually never happens, if working with work areas the same way, like fieldsymbols.
    The real benefit only comes into play, if You want to modify the data in the internal table, because You are already acting on the line of the table (pointer to record n ), what allows You, to omit any modify to transfer changed values back to the internal table.
    In terms of performance I must see it technically and I hope, someone can confirm/reject my statement, so that I (if I was wrong) could keep that in mind.
    A fieldsymbol (lets talk about them in technical way, as a pointer) is in fact a variable, which holds an address of another variable( which itself also can hold an address and so on).
    Pointers are either 4 byte or 8 byte. So, it does not matter, how much columns Your internal table has, technically the fieldsymbol is either 4 byte big or 8 byte big. And exactly this amount is used in the ram of the application server.
    In fact pointers even do not have a type, as usual pointers are always integer.
    A workarea is a linear, continous allocation of memory space, exacly matching the data-structure, which is used for declaration. So it is obvious, that this workarea uses much more memory of the ram, as long their elements exceed 4 / 8 bytes.
    Still then it is not more performant, because changed data of a workarea has to be transferred to the internal table, (mostly, if one wants to modify), but with field-symbols this step is removed.
    So in fact there are two technical reasons for using field-symbols.
    One is, You save memory-space and the second is, You save the transferring.
    In an even deeper way, one can say, that , by design, a cpu with its address bus is just intended to understand addresses best ( directly after 0 and 1 and hex ).

Maybe you are looking for