Problem with field-symbol values not updating

H i ,
      I have following piece of code :
Assigning Dynamic Table to Field Symbol
    ASSIGN ist_dyn_table->* TO <gs_dyn_table>.
*   Creating Structure for dynamic table
    CREATE DATA gs_dyn_line LIKE LINE OF <gs_dyn_table>.
*   Creating line type for the Dynamic Values
    ASSIGN gs_dyn_line->* TO <gs_line>.
*   Populating values in the dynamic table
    LOOP AT ist_pwcl_main INTO wa_pwcl_main.
      ASSIGN COMPONENT gc_fld_werks OF STRUCTURE <gs_line> TO <gs_field>.
   1   IF sy-subrc EQ 0.
   2        <gs_field> = wa_pwcl_main-werks.
   3      ENDIF.
   5  IF <gs_field> IS ASSIGNED.
   6     <gs_field> = wa_pwcl_main-vbeln.
      ENDIF.
  7 IF <gs_field> IS ASSIGNED.
  8  <gs_field> =  wa_pwcl_main-posnr.
      ENDIF.
   IF <gs_field> IS ASSIGNED.
        <gs_field> = wa_pwcl_main-quant.
      ENDIF.
on debugging  at line 2 <gs_filed> contains the value of werks .
but at line 6 <gs_field> contains value of vbeln as 0 and at 8 of posnr as 0 .
What can be the problem ? Other values are getting assigned properly .
Plz help ...
Regards .

Hi,
Assigning Dynamic Table to Field Symbol
    ASSIGN ist_dyn_table->* TO <gs_dyn_table>.
  Creating Structure for dynamic table
    CREATE DATA gs_dyn_line LIKE LINE OF <gs_dyn_table>.
  Creating line type for the Dynamic Values
    ASSIGN gs_dyn_line->* TO <gs_line>.
  Populating values in the dynamic table
    LOOP AT ist_pwcl_main INTO wa_pwcl_main.
      ASSIGN COMPONENT gc_fld_werks OF STRUCTURE <gs_line> TO <gs_field>.
   1   IF sy-subrc EQ 0.
   2        <gs_field> = wa_pwcl_main-werks.
   3      ENDIF.
   5  IF <gs_field> IS ASSIGNED.
   6     <gs_field> = wa_pwcl_main-vbeln.
      ENDIF.
  7 IF <gs_field> IS ASSIGNED.
  8  <gs_field> =  wa_pwcl_main-posnr.
      ENDIF.
   IF <gs_field> IS ASSIGNED.
        <gs_field> = wa_pwcl_main-quant.
      ENDIF.
Based on your coding above, <gs_field> has been assigned with data type 'WERKS' (i'd assume component gc_fld_werks found from structure <gs_line> is a plant typed), which is a CHAR(4) data type.
Meaning, if <gs_field> is assigned with Plant type value, e.g. <gs_field> = '1000', field symbol <gs_field> will contain 4 character only.
At line 6, if wa_pwcl_main-vbeln = '0000201000', <gs_field> is only capturing '0000' only. This is also happened to line 8.
However, it looks like that <gs_field> is getting over-write if ASSIGNED statement returns SY-SUBRC = 0.
Hope this helps.
Regards,
Patrick

Similar Messages

  • Is anyone having problems with the stock widget not updating?

    Is anyone having problems with the stock widget not updating?

    Widgets unfortunately have gone by the wayside since Apple introduced the App Store a couple years ago.  No widget has received any official recognition in the Apple listing of Widgets since that time.  So it is entirely possible the widget has gotten redirected.   There are many other Apps for stocks.  I personally like the Nasdaq Quote website since it knows mutual funds and other markets as well.

  • Problem with field symbols in ecc 6.0

    i have the following  code  written in 4.6 version   now i am executing the old report   in 6.0  but  i am facing with some unicode error.
      FIELD-SYMBOLS:
        <line_of_bs_table> LIKE tbl1024,
       READ TABLE bs_table INDEX row_bst ASSIGNING  <line_of_bs_table> .
        buffer_bsbuffer_ptr(aux) =  <line_of_bs_table> >col_bst.
    tb1024 is standard sap structure  for storing buffer contents
    i have the following error in ecc 6.0
    structure type   '<line_of_bs_table> >+col_bst'  does not start with a charecter type  field in unicode programs in such cases
    offset/ length declarations are not allowed.
    can any one tell how can a field symbol  structure is changed  to charecter  type.

    Hi elinuk,
    you have already posted this thread in the ABAP general forum under problem in field symbols in ecc6.0 and I think that this forum is more related to this issue than the DMS forum. So please close this thread and investigate this issue further in the ABAP general forum.
    Best regards,
    Christoph

  • Problem with FIELD SYMBOL upgrading from 46c to ECC6.0

    Hi people... i'm having big trouble making an upgrade from 4.6c to ECC6.0 with this portion of code of Z's programm.
    In the line
    ASSIGN (w_field) TO <fs_field>.
    i don't see any assigment, so <fs_field> remains empty, when enters into firts IF conditions it is TRUE, then go into second IF condition, it is FALSE, and finally assing
    <fs_field> = '/'.
    , at this point i have a DUMP telling me MOVE_TO_LIT_NOTALLOWED_NODATA
    I'm try any way of definition, assigment, but always i have a DUMP.
    Someone can give a hand with this issue!
    Thanks in advance!!!
    This is the full code from the FORM with the problem.
    *       FORM GRABA                                        *
    *  -->  VALUE(P_TABLE)                                  *
    FORM graba USING value(p_table) TYPE c.
      DATA:
        w_field(60),
        w_dd03l  TYPE dd03l.
      FIELD-SYMBOLS <fs_field>.
      CLEAR w_flag.
      CASE p_table.
        WHEN 'BGR00'.
          d_bgr00-group  = w_batin.
          d_bgr00-mandt  = sy-mandt.
          d_bgr00-usnam  = sy-uname.
          d_bgr00-xkeep  = 'X'.
          d_bgr00-nodata = '/'.
          d_bgr00-stype = 0.
          TRANSFER d_bgr00 TO w_fname.
        WHEN 'BBKPF'.
          LOOP AT gt_dd03l INTO w_dd03l WHERE tabname EQ p_table.
            CONCATENATE
                'd_'
                w_dd03l-tabname
                w_dd03l-fieldname
              INTO w_field.
            ASSIGN (w_field) TO <fs_field>.
            IF <fs_field> IS INITIAL OR <fs_field> EQ '/'.
              IF w_dd03l-fieldname EQ 'TBNAM'.
                <fs_field> = p_table.
              ELSE.
                <fs_field> = '/'.
              ENDIF.
            ELSE.
              w_flag = 'X'.
            ENDIF.
          ENDLOOP.
          TRANSFER d_bbkpf TO w_fname.
        WHEN 'BBSEG'.
          LOOP AT gt_dd03l INTO w_dd03l WHERE tabname EQ p_table.
            CONCATENATE
                'd_'
                w_dd03l-tabname
                w_dd03l-fieldname
              INTO w_field.
            ASSIGN (w_field) TO <fs_field>.
            IF <fs_field> IS INITIAL OR <fs_field> EQ '/'.
              IF w_dd03l-fieldname EQ 'TBNAM'.
                <fs_field> = p_table.
              ELSE.
                <fs_field> = '/'.
              ENDIF.
            ELSE.
              w_flag = 'X'.
            ENDIF.
          ENDLOOP.
          TRANSFER d_bbseg TO w_fname.
      ENDCASE.
    ENDFORM.
    Edited by: Matt on Dec 15, 2008 5:03 PM - Made subject more informative

    Gentlemen:
    The problem around this statement:
    ASSIGN (w_field) TO <fs_field>
    is explained as follows:
    1. In ABAP language, there are two ways for assigning a new value to a field-symbol.
    - Sentence: ASSIGN (values) TO <my_field_symbol>.
      In this case, the <my_field_symbol> receives from (w_field) the data type and value content of this variable. So, we keep that a FSymbol is assigned and, at the same time, receives an initial value.
    - Sentence: <my_field_symbol> = '/' or <my_field_symbol> = my_var.
      In this way, we only pass the content of the variable next to = sign. But before this, the field-symbol must had been assigned (using ASSIGN statement), in another case, the compiler raises an exception.
    Following the example of Federico... I think he tried to assign a field like this (please, supose the program imports the structure of a database table with a standard function, into a internal table which is looped by the work area w_field ):
    - If w_field contains 'BKPF-WERKS', so sentence ASSIGN will affect the field symbol, passing to this the data type and current content of table field BKPF-WERKS.
    - If w_field contains 'BKPF-.INCLUDE': *the column .INCLUDE obviously is not associated with a data type... so our statement ASSIGN... TO... never pass any data type or value to our field-symbol. So that, this field is never initialized properly, and when inmmediately you try to execute something like this: <my_field_symbol> = '/', the game (program) is over.. XD
    I hope this post was helpful for anyone...
    Best Regards!!
    RRG
    ABAPer(u) - EVOLution

  • Problem with field symbol

    Hi!
    I have a problem with a field-symbol like this:
    DATA: gt_coep_ext TYPE kaep_t_coep_ext.
    field-symbols <gt_data> type table.
    ASSIGN gt_coep_ext TO <gt_pos_data>
    This field symbol is used in the FM REUSE_ALV_GRID_DISPLAY as output table. I need add two fields in this <gt_data>. Is there any way to add new fields in the <gt_data> structure.
    Thanks!!

    Create your one Fieldcat
    Global data declaration  ***
    TYPE-POOLS: SLIS.
    <types: ... .                    " user definded types>
    DATA:   GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:   G_REPID LIKE SY-REPID.
    DATA:   GT_OUTTAB TYPE <UD_STRUCT>  OCCURS 0 WITH HEADER LINE.
    <data:  ... .                    " user specific data>
    Initialization field catalog  ***
    INITIALIZATION.
      G_REPID = SY-REPID.
      PERFORM FIELDCAT_INIT USING GT_FIELDCAT[].
    Data selection  ***
    START-OF-SELECTION.
      PERFORM SELECT_DATA TABLES GT_OUTTAB.
    Display list  ***
    END-OF-SELECTION.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM = G_REPID
                IT_FIELDCAT        = GT_FIELDCAT[]
           TABLES
                T_OUTTAB           = GT_OUTTAB.
    FORMS  ***
    FORM FIELDCAT_INIT USING RT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
         DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
         DATA: POS TYPE I VALUE 1.
    Initialize keyfield(s)
    CLEAR LS_FIELDCAT.
    LS_FIELDCAT-COL_POS       =   POS.
    LS_FIELDCAT-FIELDNAME     =   <GT_OUTTAB_FIELD_NAME>.
    LS_FIELDCAT-REF_FIELDNAME =   <DDIC_REF_FIELD_NAME>.
    LS_FIELDCAT-REF_TABNAME   =   <DDIC_REF_TABLE_NAME>.
    LS_FIELDCAT-KEY           =   'X'.      " sets key field
       APPEND LS_FIELDCAT TO RT_FIELDCAT.
    Initialize normal field(s)
    POS = POS + 1.
    clear ls_fieldcat.
    ls_fieldcat-col_pos       =   pos.
    LS_FIELDCAT-FIELDNAME     =   <GT_OUTTAB_FIELD_NAME>.
    LS_FIELDCAT-REF_FIELDNAME =   <DDIC_REF_FIELD_NAME>.
    LS_FIELDCAT-REF_TABNAME   =   <DDIC_REF_TABLE_NAME>.
       APPEND LS_FIELDCAT TO RT_FIELDCAT.
    Initialize hidden field(s)
    POS = POS + 1.
    clear ls_fieldcat.
    ls_fieldcat-col_pos       =   pos.
    LS_FIELDCAT-FIELDNAME     =   <GT_OUTTAB_FIELD_NAME>.
    LS_FIELDCAT-REF_FIELDNAME =   <DDIC_REF_FIELD_NAME>.
    LS_FIELDCAT-REF_TABNAME   =   <DDIC_REF_TABLE_NAME>.
    LS_FIELDCAT-NO_OUT        =   'X'.      " sets hidden field
       APPEND LS_FIELDCAT TO RT_FIELDCAT.
    ENDFORM.    " fieldcat_init
    FORM SELECT_DATA TABLES RT_OUTTAB LIKE GT_OUTTAB[].
    <user specific data selection>
    ENDFORM.  " select_data

  • Problem with field symbols

    Hi ,
    I have to use an internal table in a form which can have differnet structures at diffrenet points of time. 
    As the internal table is dynamic , I have declared a field symbol for this.I need to use th efields in this internal table for processing inside a loop.But because i have to use an untyped field symbol , I am getting an error that the field QUANT is not there in <fs_order_tab>.
    Please let me know what to do in such a situation.Thanks in advance.
    FIELD-SYMBOLS :<fs_order_tab> TYPE STANDARD TABLE,
                                 <fs_order_wa>  TYPE ANY.
    ASSIGN i_so TO <fs_order_tab>.
    ASSIGN wa_so TO <fs_order_wa>.
    LOOP AT<fs_order_tab> into <fs_order_wa>..
    l_quant = <fs_order_wa>-QUANT.
    ENDLOOP.

    Hi Rashmi,
    Kindly follow the steps given  below. 
    After assigning the internal table to the field symbol,
      create 1 more field symbols of the following type
    <fs_quant>     TYPE vbep-bmeng,
      Create 1 constant.
        CONSTANTS: lc_quant  TYPE c LENGTH 5 VALUE 'QUANT'.
      and then assign the field quantity  to the field symbol
          ASSIGN COMPONENT lc_quant  OF STRUCTURE <fs_order_wa> TO <fs_quant>.
    Inside the loop write the following statement
      l_quant = <fs_quant>
    Hope this helps in solving your query.
    Edited by: Kadian.Arjun on Nov 22, 2010 9:56 AM

  • Problem with Field-symbols when copying code from 4.7 to 4.6C

    Dear SDN
    I developed the code below for 4.7 system. It works fine on 4.7, but it is failing to compile on 4.6C.
    field-symbols : <pnnnn> type any.
    assign ('wa') to <pnnnn>.
    move-corresponding p0001 to <pnnnn>. " <i>Error <pnnnn> is not an internal table with a header line</i>
    unassign <pnnnn>.
    Can anyone please assist?
    Regards
    Kriger

    You cannot use MOVE-CORRESPONDING with untyped variables in 4.6c. If you move infotype data between infotype buffer (of type PRELP) and infotype workarea, then you should use MOVE.

  • Problem with field-symbols in UNICODE conversion

    Hi all.
    I'm in a UNICODE conversion project and I have a problem with a program that uses field-symbols.
    DATA: BEGIN OF wa_data_aux,
            mandt LIKE zindices-mandt,
            kschl LIKE zindices-kschl,
            datab LIKE zindices-datab,
            valor LIKE zindices-valor,
            descripcion LIKE zindices-descripcion,
            ernam LIKE zindices-ernam,
            erdat LIKE zindices-erdat,
            waers LIKE zindices-waers,
          END OF wa_data_aux.
    FIELD-SYMBOLS:
                   <fs2>  TYPE ANY,
                   <fs3>  LIKE wa_data_aux.
              <fs2> = <fs3>.
    This assignment results in a DUMP.
    Can anybody help me to solve this problem?
    Thanks!!

    TYPES: BEGIN OF wa_data_aux,
              mandt TYPE mandt,
              kschl TYPE kschl,
              erdat TYPE d,
              waers TYPE waers,
          END OF wa_data_aux.
    DATA: w_aux TYPE wa_data_aux.
    FIELD-SYMBOLS:
    <fs2> TYPE ANY,
    <fs3> TYPE wa_data_aux.
    w_aux-mandt = '300'.
    ASSIGN w_aux TO <fs3>.
    ASSIGN <fs3> TO <fs2>.
    WRITE : / <fs2>.
    GBY.

  • Problem with ios certificate server not updating the CRL

    Hi all,
    The background is that i'm currently setting up a DMVPN solution with the ipsec tunnels between the spokes created using certificates.
    I'm using a cisco 877 as the CA server (its running 12.4(6)T5) to provide the certificates to the spoke routers. This part is working fine - the spokes can request a certificate and get one issue all well and good.
    The problem is on the CA, the CRL lifetime is set to 24 hours but the CA is not updating the CRL so when the spokes look for the revocation list (as set in their trustpoint) they are reporting an error that the CRL is out of date and won't connect.
    If is do a '#sh crypto pki server' it lists a 'CRL NextUpdate timer. this has a timestamp that is 24 hours after the last certificate was revocked. The only way i can get the CRL to be re-generated is to revoke a certificate.
    So, my question is, have i missed something here? I thought the CA would automatically generat a new CRL file every 24hours.
    Can anyone help?
    thanks.

    Hi Mark (?)
    this seems to match this bug:
    CSCsy95838    IOS CA: CRL not updated, update timer no started
    However it does not mention if 12.4(6)T5 is affected, only that it was found in 12.4(15)T3 and resolved in 12.4(15)T10 and other more recent releases.
    I would suggest trying the latest 12.4(15)Tx, 15.0(1)Mx or 15.1(4)Mx release if you can.
    I supposed you've though of it, but just in case: as a workaround you can disable the CRL check on all the DMVPN routers, obviously they will still allow connections from routers with a revoked spoke.
    As a (temporary?) replacement for a CRL, you could use a "certificate ACL" with which you can kind of create a "manual local CRL" :
      crypto pki certificate map certACL 10
       serial-number ne
       serial-number ne
       etc.
      crypto pki trustpoint myTP
       match certificate certACL
    (note the "ne" stands for "not equal" so you are permitting any certificate whose serial number is not listed)
    Obviously you would have to configure (and maintain!) this on each router participating in the DMVPN so this is cumbersome, but I suppose if you don't often revoke certs it might be an option.
    hth
    Herbert
    If this post answers your question, please click the "Correct Answer" button

  • Problem with field-symbols usage

    Hi guys,
    I am trying to read a record of table gi_outtab as follows:
    read table gi_outtab into wa_outtab index wa_ir2_data_changed-row_id.
    And now i want the value of a field of wa_outtab and this field is contained in a field-symbol <field> .
    I thought wa_outtab-<field> would give the value for that field. But it gives syntax error saying component doesn't exist.How do I fix it ? Any help or sample code to fix this error is greatly appreciated.The code is below.
    Thanks,
    SHK
    I have fieldname info and row index info in wa_ir2_data_changed.I assign field-name info to a field-symbol.wa_outtab-<field> gives error saying no component like that exists. <field> dynamically changes for ever iteration of the loop below.How do I fix it ?
    data : wa_ir2_data_changed like line of ir2_data_changed->mt_good_cells.
    field-symbols : <field> type ANY .
    loop at ir2_data_changed->mt_good_cells into wa_ir2_data_changed.
    assign wa_ir2_data_changed-fieldname to <field> .
    read table gi_outtab into wa_outtab index wa_ir2_data_changed-row_id.
    call method ir2_data_changed->modify_cell
       exporting i_row_id  = wa_ir2_data_changed-row_id
               i_fieldname = wa_ir2_data_changed-fieldname
               i_value     = wa_outtab-<field>.
    endloop.
    wa_ir2_data_changed has 3 components.
    a) row_id
    b) fieldname
    c) value

    The following code fixed it.Thanks Suresh for the tip.
    loop at ir2_data_changed->mt_good_cells into wa_ir2_data_changed.
    read table gi_outtab into wa_outtab index wa_ir2_data_changed-row_id.
    ASSIGN COMPONENT wa_ir2_data_changed-fieldname of structure wa_outtab to
    <field>.
    call method ir2_data_changed->modify_cell
       exporting i_row_id  = wa_ir2_data_changed-row_id
               i_fieldname = wa_ir2_data_changed-fieldname
               i_value     = <field>.
    endloop.

  • Got big problem with my iphone , its not charging as it did before i updated (5.0.1) Now its charging very slowly and it doesnt show the charging sign on screen..

    got big problem with my iphone4 , its not charging as it did before i updated (5.0.1) Now its charging very slowly and it doesnt show the charging sign on screen..

    How do you know its charging very very slowly? Is the screen back on?
    Once a month you should charge your phone to 100% then drain it, then charge it back up to 100%.
    Just leave the phone in and do what is said above.
    How long do you think it will take to charge to 100%?

  • Field symbol has not yet been assigned. ???

    Dear Experts ,
    W hen i tried to execute my program this error appears :
    Short text
        Field symbol has not yet been assigned.
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "SAPLSLVC" had to be terminated because it has
        come across a statement that unfortunately cannot be executed.
    Error analysis
        You attempted to access an unassigned field symbol
        (data segment 32821).
        This error may occur if
        - You address a typed field symbol before it has been set with
          ASSIGN
        - You address a field symbol that pointed to the line of an
          internal table that was deleted
        - You address a field symbol that was previously reset using
          UNASSIGN or that pointed to a local field that no
          longer exists
        - You address a global function interface, although the
          respective function module is not active - that is, is
          not in the list of active calls. The list of active calls
          can be taken from this short dump.
    and Here is my CODE :
    *& Report  ZPO
    Report  ZPO1.
    type-pools slis.
      PARAMETERS : PO_Doc like EKBE-EBELN DEFAULT '4800000007'.
      PARAMETERS : Plant TYPE WERKS DEFAULT '1000'.
      PARAMETERS : PO_ORG TYPE EKORG DEFAULT ''.
      data TtlS type mara-wesch .
      data TtlH type mara-wesch .
      data Ttl type mara-wesch .
      data ZEKBE type TABLE OF EKBE.
      data ZEKBER type EKBE.
      data ZEKPO type TABLE OF EKPO.
      data ZEKPOR type EKPO.
      data ZEKKOR TYPE EKKO.
      data ZNAME1F type LFA1-LIFNR.
      data ZWGBEZF TYPE T023T-WGBEZ.
      data i type n.
      data counter type n.
    types : begin of SBAGDS,
      Serial Type n, "Purchase Order
      EBELN like EKKO-EBELN, "Purchase Order
      MATNR like EKPO-MATNR, "Material
      TXZ01 like EKPO-TXZ01, "Short Text
      MATKL like EKPO-MATKL, "Material Group
      WGBEZ like T023T-WGBEZ, "Material Group Desc"
      SUBMI like EKKO-SUBMI, "GPM
      CHARG like EKBE-CHARG, "Batch
      LIFNR like EKKO-LIFNR, "Vendor
      NAME1 like LFA1-NAME1, "Vendor Name
      RECV like mara-wesch, "Received Quantity
      REVR like mara-wesch, "Reversed Quantity
      DELV like mara-wesch, "Delivered Quantity
    end of SBAGDS .
    DATA : BAGDS TYPE SBAGDS OCCURS 0 WITH HEADER LINE.
    data Struc like BAGDS.
    data: gr_table like BAGDS OCCURS 0 WITH HEADER LINE.
    data: gt_fieldcat type slis_t_fieldcat_alv, gt_outtab type SBAGDS occurs 0 with header line.
    INITIALIZATION.
    i = 0.
    counter = 0 .
    perform field_cat_init using gt_fieldcat[].
    FORM field_cat_init using rt_fieldcat type slis_t_fieldcat_alv.
    data: ls_fieldcat type slis_fieldcat_alv,
             pos type i value 1.
    clear LS_FIELDCAT.
    *Column 1
    ls_fieldcat-col_pos           = pos.
    ls_fieldcat-fieldname        = 'Serial'.
    ls_fieldcat-SELTEXT_L      = 'Serial'.
    ls_fieldcat-DDICTXT          = 'L'.
    append ls_fieldcat to rt_fieldcat.
    clear ls_fieldcat.
    pos = pos + 1.
    *Column 2
    ls_fieldcat-col_pos           = pos.
    ls_fieldcat-fieldname        = 'EBELN'.
    ls_fieldcat-SELTEXT_L      = 'Purchase Order'.
    ls_fieldcat-DDICTXT          = 'L'.
    append ls_fieldcat to rt_fieldcat.
    clear ls_fieldcat.
    pos = pos + 1.
    *Column 3
    ls_fieldcat-col_pos           = pos.
    ls_fieldcat-fieldname        = 'MATNR'.
    ls_fieldcat-SELTEXT_L      = 'Material'.
    ls_fieldcat-DDICTXT          = 'L'.
    append ls_fieldcat to rt_fieldcat.
    clear ls_fieldcat.
    pos = pos + 1.
    *Column 4
    ls_fieldcat-col_pos           = pos.
    ls_fieldcat-fieldname        = 'TXZ01'.
    ls_fieldcat-SELTEXT_L      = 'Short Text'.
    ls_fieldcat-DDICTXT          = 'L'.
    append ls_fieldcat to rt_fieldcat.
    clear ls_fieldcat.
    pos = pos + 1.
    *Column 5
    ls_fieldcat-col_pos           = pos.
    ls_fieldcat-fieldname        = 'MATKL'.
    ls_fieldcat-SELTEXT_L      = 'Material Group'.
    ls_fieldcat-DDICTXT          = 'L'.
    append ls_fieldcat to rt_fieldcat.
    clear ls_fieldcat.
    pos = pos + 1.
    *Column 6
    ls_fieldcat-col_pos           = pos.
    ls_fieldcat-fieldname        = 'WGBEZ'.
    ls_fieldcat-SELTEXT_L      = 'Material Group Desc'.
    ls_fieldcat-DDICTXT          = 'L'.
    append ls_fieldcat to rt_fieldcat.
    clear ls_fieldcat.
    pos = pos + 1.
    *Column 7
    ls_fieldcat-col_pos           = pos.
    ls_fieldcat-fieldname        = 'SUBMI'.
    ls_fieldcat-SELTEXT_L      = 'GPM'.
    ls_fieldcat-DDICTXT          = 'L'.
    append ls_fieldcat to rt_fieldcat.
    clear ls_fieldcat.
    pos = pos + 1.
    *Column 8
    ls_fieldcat-col_pos           = pos.
    ls_fieldcat-fieldname        = 'CHARG'.
    ls_fieldcat-SELTEXT_L      = 'Batch'.
    ls_fieldcat-DDICTXT          = 'L'.
    append ls_fieldcat to rt_fieldcat.
    clear ls_fieldcat.
    pos = pos + 1.
    *Column 9
    ls_fieldcat-col_pos           = pos.
    ls_fieldcat-fieldname        = 'LIFNR'.
    ls_fieldcat-SELTEXT_L      = 'Vendor'.
    ls_fieldcat-DDICTXT          = 'L'.
    append ls_fieldcat to rt_fieldcat.
    clear ls_fieldcat.
    pos = pos + 1.
    *Column 10
    ls_fieldcat-col_pos           = pos.
    ls_fieldcat-fieldname        = 'NAME1'.
    ls_fieldcat-SELTEXT_L      = 'Vendor Name'.
    ls_fieldcat-DDICTXT          = 'L'.
    append ls_fieldcat to rt_fieldcat.
    clear ls_fieldcat.
    pos = pos + 1.
    *Column 11
    ls_fieldcat-col_pos           = pos.
    ls_fieldcat-fieldname        = 'RECV'.
    ls_fieldcat-SELTEXT_L      = 'Received Quantity'.
    ls_fieldcat-DDICTXT          = 'L'.
    append ls_fieldcat to rt_fieldcat.
    clear ls_fieldcat.
    pos = pos + 1.
    *Column 12
    ls_fieldcat-col_pos           = pos.
    ls_fieldcat-fieldname        = 'REVR'.
    ls_fieldcat-SELTEXT_L      = 'Reversed Quantity'.
    ls_fieldcat-DDICTXT          = 'L'.
    append ls_fieldcat to rt_fieldcat.
    clear ls_fieldcat.
    pos = pos + 1.
    *Column 13
    ls_fieldcat-col_pos           = pos.
    ls_fieldcat-fieldname        = 'DELV'.
    ls_fieldcat-SELTEXT_L      = 'Delivered Quantity'.
    ls_fieldcat-DDICTXT          = 'L'.
    append ls_fieldcat to rt_fieldcat.
    clear ls_fieldcat.
    pos = pos + 1.
    endform.
    START-OF-SELECTION.
           select SINGLE * from EKKO into ZEKKOR where EBELN = PO_DOC.
           select SINGLE * from EKPO into ZEKPOR where EBELN = PO_DOC.
           select SINGLE NAME1 from LFA1 into ZNAME1F where LIFNR = ZEKKOR-LIFNR.
    *         ' Buliding Structure
              Struc-EBELN = ZEKPOR-EBELN.
              Struc-SUBMI = ZEKKOR-SUBMI.
              Struc-LIFNR = ZEKKOR-LIFNR.
              Struc-Name1 = ZNAME1F.
           select * from EKPO into TABLE ZEKPO where EBELN = PO_Doc and WERKS = plant.
           LOOP at ZEKPO into ZEKPOR.
               select SINGLE WGBEZ from T023T into ZWGBEZF  WHERE MATKL = ZEKPOR-MATKL .
               counter = counter + 1.
    *         ' Buliding Structure
              Struc-Serial = counter.
              Struc-MATNR = ZEKPOR-MATNR.
              Struc-TXZ01 = ZEKPOR-TXZ01.
              Struc-MATKL = ZEKPOR-MATKL.
              Struc-WGBEZ = ZWGBEZF.
    *          Calcualting Debit transactions from PO History
               select * from EKBE into table ZEKBE where EBELN = PO_Doc and MATNR = ZEKPOR-MATNR and  EBELP = ZEKPOR-EBELP and BWART NOT LIKE '' and SHKZG = 'S'.
               LOOP AT ZEKBE INTO ZEKBER.
                   TtlS = TtlS + ZEKBER-MENGE.
               ENDLOOP.
    *          ' Buliding Structure
               Struc-CHARG = ZEKBER-CHARG.
               Struc-RECV = TtlS.
               Ttl = TtlS.
               clear TtlS.
    *         Calcualting Credit transactions from PO History
             select * from EKBE into table ZEKBE where EBELN = PO_Doc and MATNR = ZEKPOR-MATNR and  EBELP = ZEKPOR-EBELP and BWART NOT LIKE '' and SHKZG = 'H'.
               LOOP AT ZEKBE INTO ZEKBER.
                   TtlH = TtlH + ZEKBER-MENGE.
               ENDLOOP.
    *          ' Buliding Structure
               Struc-REVR = TtlH.
    *          Calculating Total Delivered
               Ttl = Ttl - TtlH.
               clear TtlH.
    *          ' Buliding Structure
               Struc-DELV = Ttl.
               clear Ttl.
    *      Writtng ITAB
           APPEND Struc to BAGDS.
           ENDLOOP.
    *      Reading ITAB
    *       WRITE : / , 'ITAB Begin : '    .
    *       loop at  BAGDS into Struc.
    *         counter = counter + 1.
    *         write : /,'Serial : ',counter.
    *         write : / ,'PO : ',Struc-EBELN.
    *         write : / ,'Vendor : ',Struc-LIFNR.
    *         write : / ,'Vendor Name : ',Struc-NAME1.
    *         write : / ,'Material : ',Struc-MATNR.
    *         write : /,'Short Text: ',Struc-TXZ01.
    *         write : / ,'Model : ',Struc-MATKL.
    *         write : / ,'Model Desc : ',Struc-WGBEZ.
    *         write : /,'GPM : ',Struc-SUBMI.
    *         write : /,'Lot : ',Struc-CHARG.
    *         write : /,'Received : ',Struc-RECV.
    *         write : /,'Reversed : ',Struc-REVR.
    *         write : /,'Delivered : ',Struc-DELV,/,/,/.
    *       ENDLOOP.
    * Call ALV Grid Viewer
    *BREAK-POINT.
    gr_Table[] = BAGDS[].
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
                 I_STRUCTURE_NAME   = 'SBAGDS'
                 IT_FIELDCAT          = gt_fieldcat[]
            TABLES
                 T_OUTTAB                  = gr_Table.
    Please Advise
    Edited by: Sap Sap on Jul 27, 2009 12:18 PM
    Edited by: Sap Sap on Jul 27, 2009 12:22 PM
    Edited by: Sap Sap on Jul 27, 2009 12:22 PM

    Hi,
    The problem seems to be in your ALV grid display.
    The reason must be your field catalog.
    Just check your fieldcatalog.
    The value in the fieldname field of the fieldcatalog should be same as the fieldname in your internal table and should be in capital letters.
    Probably you must have mistyped some field.
    Kinldy check.
    Regards,
    Ankur Parab

  • Dynamic select with field symbols

    Hi guys,
    I have 2 tables.
    First table is the popup fields using fm popup_get_values:
    tab1-tabname
    tab1-fieldname
    tab1-value
    Second table is the input fields to be displayed in the popup box:
    tab2-transactno
    tab2-docno
    tab2-customer
    tab2-postdate
    etc... (it has many fields)
    Let's say currently i loop at tab2 and assign each value of the individual fields to a variable each:
    loop at tab2
    v_transactno = tab2-transactno
    v_docno = tab2-docno
    etc...
    endloop.
    My question is how do i assign each variable to the popup fields according to the fieldname so that it can get its corresponding value correctly?
    How can this be done dynamically?
    Can the loop above be done dynamically as well coz it has alot of fields to cater for?
    Please help me solve this problem. Futher similar examples would be much appreciated as well.
    Thank you very much!

    Hi
    see the concept of field sysmbols and do accordingly
    Field Symbols
    Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.
    Field symbols are similar to dereferenced pointers in C (that is, pointers to which the content operator * is applied). However, the only real equivalent of pointers in ABAP, that is, variables that contain a memory address (reference) and that can be used without the contents operator, are reference variables in ABAP Objects.
    All operations programmed with field symbols are applied to the field assigned to it. For example, a MOVE statement between two field symbols moves the contents of the field assigned to the first field symbol to the field assigned to the second field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before.
    You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks the compatibility of the field symbol and the field you are assigning to it during the ASSIGN statement.
    Field symbols provide greater flexibility when you address data objects:
    If you want to process sections of fields, you can specify the offset and length of the field dynamically.
    You can assign one field symbol to another, which allows you to address parts of fields.
    Assignments to field symbols may extend beyond field boundaries. This allows you to address regular sequences of fields in memory efficiently.
    You can also force a field symbol to take different technical attributes from those of the field assigned to it.
    The flexibility of field symbols provides elegant solutions to certain problems. On the other hand, it does mean that errors can easily occur. Since fields are not assigned to field symbols until runtime, the effectiveness of syntax and security checks is very limited for operations involving field symbols. This can lead to runtime errors or incorrect data assignments.
    While runtime errors indicate an obvious problem, incorrect data assignments are dangerous because they can be very difficult to detect. For this reason, you should only use field symbols if you cannot achieve the same result using other ABAP statements.
    For example, you may want to process part of a string where the offset and length depend on the contents of the field. You could use field symbols in this case. However, since the MOVE statement also supports variable offset and length specifications, you should use it instead. The MOVE statement (with your own auxiliary variables if required) is much safer than using field symbols, since it cannot address memory beyond the boundary of a field. However, field symbols may improve performance in some cases.
    check the below links u will get the answers for your questions
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_sy.htm
    http://searchsap.techtarget.com/tip/1,289483,sid21_gci920484,00.html
    Syntax Diagram
    FIELD-SYMBOLS
    Basic form
    FIELD-SYMBOLS <fs>.
    Extras:
    1. ... TYPE type
    2. ... TYPE REF TO cif
    3. ... TYPE REF TO DATA
    4. ... TYPE LINE OF type
    5. ... LIKE s
    6. ... LIKE LINE OF s
    7. ... TYPE tabkind
    8. ... STRUCTURE s DEFAULT wa
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Untyped Field Symbols ad Cannot Use Field Symbols as Components of Classes.
    Effect
    This statement declares a symbolic field called <fs>. At runtime, you can assign a concrete field to the field symbol using ASSIGN. All operations performed with the field symbol then directly affect the field assigned to it.
    You can only use one of the additions.
    Example
    Output aircraft type from the table SFLIGHT using a field symbol:
    FIELD-SYMBOLS <PT> TYPE ANY.
    DATA SFLIGHT_WA TYPE SFLIGHT.
    ASSIGN SFLIGHT_WA-PLANETYPE TO <PT>.
    WRITE <PT>.
    Addition 1
    ... TYPE type
    Addition 2
    ... TYPE REF TO cif
    Addition 3
    ... TYPE REF TO DATA
    Addition 4
    ... TYPE LINE OF type
    Addition 5
    ... LIKE s
    Addition 6
    ... LIKE LINE OF s
    Addition 7
    ... TYPE tabkind
    Effect
    You can define the type of the field symbol using additions 2 to 7 (just as you can for FORM parameters (compare Defining the Type of Subroutine Parameters). When you use the ASSIGN statement, the system carries out the same type checks as for USING parameters of FORMs.
    This addition is not allowed in an ABAP Objects context. See Cannot Use Obsolete Casting for FIELD SYMBOLS.
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See Defining Types Using STRUCTURE.
    Effect
    Assigns any (internal) field string or structure to the field symbol from the ABAP Dictionary (s). All fields of the structure can be addressed by name: <fs>-fieldname. The structured field symbol points initially to the work area wa specified after DEFAULT.
    The work area wa must be at least as long as the structure s. If s contains fields of the type I or F, wa should have the structure s or at least begin in that way, since otherwise alignment problems may occur.
    Example
    Address components of the flight bookings table SBOOK using a field symbol:
    DATA SBOOK_WA LIKE SBOOK.
    FIELD-SYMBOLS <SB> STRUCTURE SBOOK
    DEFAULT SBOOK_WA.
    WRITE: <SB>-BOOKID, <SB>-FLDATE.
    Regards
    Anji

  • How to check the length of a field symbol value

    hi all,
    i have a problem with string function, i have assined  table fields to  a field symbol in a loop i want check the length of the assigned fields symbol value  in every loop . i have written like ,,,,,len = strlen( <fs>). then i am getting the length of the field label what i ahve assigned to fiels symbol not the field value lenght ,
    please advise me on this,
    thanks,
    sre

    I think you're on the right track.  This should work:
    data: len type i.
    data: begin of itab OCCURS 1,
            a type string value '1',
            b type string value '12',
            c type string value '123',
          end of itab.
    FIELD-SYMBOLS: <fs> type ANY.
    do 3 times.
      assign component sy-index of STRUCTURE itab to <fs>.
      len = strlen( <fs> ).
    enddo.

  • Problem with "SELECT...FOR UPDATE OF..." and "POST command" combination

    Problem with "SELECT...FOR UPDATE OF..." and "POST command" combination
    Problem in committing transactions in Multiple Forms (Oracle Forms) with POST built-in command:
    Consider that the following statements are written in WHEN-WINDOW-CLOSED trigger of a called form.
    Statements in called form (Form name: FORM_CHILD):
    go_block('display_block') ;
    do_key('execute_query') ;
    -- Data from table_b will be populated in this block, based on the value of COLUMN_1 obtained
    -- from TABLE_A.
    -- Example: If the value of COLUMN_1 is 10, then all the matching records from TABLE_B, which
    -- are inserted with value 10 in TABLE_B.COLUMN_1 will be fetched and shown here.
    if user_choice = 'YES' then
    commit ;
    else
    rollback ;
    end if ;
    Statements in calling forms:
    There are two calling forms having following statements and it is going to call the above said called form.
    CALLING FORM 1
    Statements in KEY-COMMIT trigger:
    post;
    call_form(form_child, no_activate) ;
    Statements in ON-INSERT trigger:
    select column_1
    from table_a
    for update of column_1
    where column_2 = 'X' ;
    update table_a
    set column_1 = column_1 + 1
    where column_2 = 'X' ;
    insert into table_b ...;
    insert into table_b ...; Statements in KEY-COMMIT trigger:
    post;
    call_form(form_child, no_activate) ;
    CALLING FORM 2:
    Statements in ON-INSERT trigger:
    select column_1
    from table_a
    for update of column_1
    where column_2 = 'X' ;
    update table_a
    set column_1 = column_1 + 1
    where column_2 = 'X' ;
    insert into table_b ...;
    insert into table_b ...;
    insert into table_b ...;
    Our understanding:
    Assume that both the forms are running from two different machines/instances, issuing commit at the same time. In this case, forms will start executing the statements written in ON-INSERT trigger, the moment POST command is executed. Though the commit is issued at the same time, according to oracle, only one of the request will be taken for processing first. Assume that calling form 1 is getting processed first.
    So, it fetches the value available in COLUMN_1 of TABLE_A and locks the row from further select, update, etc. as SELECT...FOR UPDATE command is used (note that NOWAIT is not given, hence the lock will be released only when COMMIT or ROLLBACK happens) and proceed executing further INSERT statements. Because of the lock provided by the SELECT...FOR UPDATE command, the statements in calling form 2 will wait for the resource.
    After executing the INSERT statements, the FORM_CHILD is called. The rows inserted in to TABLE_A will be queried and shown. The database changes will be committed when user closes the window (as COMMIT is issued in its WHEN-WINDOW-CLOSED trigger). Then the SELECT...FOR UPDATE lock will be released and calling form 2's statements will be executed.
    Actual happenings or Mis-behavior:
    Calling form 2 starts executing INSERT statements instead of waiting for SELECT...FOR UPDATE lock. Also, the value selected from TABLE_A.COLUMN_1 is same in both the calling forms, which is wrong.
    The rows inserted into TABLE_B are having similar COLUMN_1 values in calling form 2 and they are fetched and shown in the called form FORM_CHILD.
    Note that in calling form 2 also POST only is issued, but the changes posted there are accessible in calling form 1 also, which is wrong.
    Kindly suggest us as to how to fix above problem. It will be much use, if you can send us the information regarding the behavior of Oracle Forms POST built-in also.
    Our mail ID: [email protected]
    Thanks a lot in advance.

    You have several problems:
    1. On-Insert will ONLY run if you have created a new record in a base-table block. If you haven't done that, then the POST command will not cause it to run.
    2. Select for update without a "no wait" will lock records for the first form, but when the second form tries this, it will hit the ORA-00054 exception, and will NOT wait. The only way you could make it wait is to issue an UPDATE sql command, which is not such a good way to go.
    All POST does is issues SQL insert or update commands for any changes the user has made to records in a form's base-table blocks, without following with a Commit command.
    Also understand that Commit is the same as Commit_Form, and Rollback is the same as Clear_Form. You should read up on these in the Forms help topics.

Maybe you are looking for

  • How do i change my headphone jack to line in audio in bootcamp?

    Hi i was wondering if it was in any way possible for me to change the Headphone jack to line in? i know i can do it in Mac os but how do i do it under bootcamp ? -verdenshersker

  • DC not available in KMC-CM SC

    Hi I have added the SC KMC-CM to my Development Track so that i can use the KM API in my DC. Now i create a Webdynpro DC. and want to add the tc/km/frwk  dc as used DC. But nothing is avaiable under the KMC-CM  SC when i click on Add used DC. Why is

  • How oracle replaces "carrage return, tab and blank" in v$sql.sql_text??

    Hi. all. I am wondering how oracle replace "carrage return, tab and blank" character to v$sql.sql_text?? I am try to find sql_id by the following query. select * from v$sql where sql_text like 'blur blur %'. However, how can I specify 'blur blur %' w

  • How to configure sapgui in mac 10.3.9 ?

    Hello all , I am trying to configure sapgui for java 7.00 rev 5 on my mac os x 10.3.9. plz let me know how to write configuration file? I am new in SAP. Thanks.

  • Applying materials to loaded objects

    Hi, I'm trying to develop a program whereby users can change the colour of an object. The object is loaded from a 3ds file. Colour accuracy is important, so I was wondering if anyone had experience with altering the properties of a loaded objects mat