Dynamic read from work area

Hello, me again ...
I have a work area declared like this:
data: begin of wa,
          fld1  type c,
          fld2  type c,
          fld3  type c,
        end of wa.
I want to check a different field's value at each iteration, meaning somthing like this:
concatenate 'fld' sy-tabix into var.
if wa-var eq ......
I know it's possible by using field-symbols, does anyone can write me the specific syntax pls ?
Thanks in advance,
Rebeka.

field-symbols: <fs>.
data: var(20) type c.
data: tabix(4) type c.
tabix = sy-tabix.
   concatenate 'FLD' tabix into var.
   condense var no-gaps.
assign component var of structure wa to <fs>.
if <fs> = 'X'.
endif.
Regards,
Rich Heilman

Similar Messages

  • Getting error Uni code check when modifying Ztable from work area?

    Hi all,
    Getting error Uni code check when modifying Ztable from work area?
    and how to increment counter when data modified?
    FM 'popup_to_confirm'.
    IMPORTING
           answer                      = RES.
    CHECK
          RES = '1'.
            WRITE :/ 'UPDATE'.
          MODIFY ZPPT_PPDPLAN FROM GWA_FIN_PROD.
    thanks in advance..

    what error you are getting. make sure source and Target are of similar sturcture.

  • System message 38 from work area ssfcomposer does not exist in va03

    Hi,
    I created a smartform copy from standard, it is working good for all sales order,but for perticular one sale order it shwing error like
    system message 038 from work area ssfcomposer does not exist.
    i have long item line in this sale order what can i do please help me.
    Regards
    KK

    If I am not wrong, I guess you are using template/table inside your smartform.. which is causing the error.
    I issue could be because of the condition on the text inside the template which might be overlapping the output structure line and column. The issue can be also be because of your table cell.
    To trouble shoot place a false condition(like 1 = 2) first on table and if error still occurs then remove condition on table and place it on structure.
    I guess, the above answer will help you to close the thread.
    Regards,
    SaiRam

  • Sytem message 047 from work area SSFCOMPOSER does not exist

    Hi Friends,
    When I am trying to see the print preview of a PO I am getting this error msg
    "Sytem message 047 from work area SSFCOMPOSER does not exist".
    I had checked the forum and the System message was 046, but the error is not solved.
    Regards,
    Anu.

    Wrong forum to post the issue.
    VJ

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

  • Dynamic reading from database table

    Hi Experts,
    While reading from a database table the below statement for deletion works:
    DELETE (p_table) FROM <fs_wadbtab>.
    p_table: name of database table which is entered as a selection screen parameter
    <fs_wadbtab> : workarea of line type P_table
    However, the below statement does not work:
    READ (p_table) FROM <fs_wadbtab>.
    My requirement is to read a record from p_table with contents in a dynamic structure.
    Kindly suggest.
    Thanks.

    Just misunderstood you.
    Edited by: Karri Kemppi on Jun 23, 2010 10:00 AM

  • Dynamic access to work area fields

    Hi
    I've got a DataBase table with 20 fields with different names.
    field1
    field2
    field3.
    field20
    I'm using a work area to read values and i wanna read an specific field of this work area.
    The problem is the following:
    I don't know the name of the field i need to access, instead, i have it in a field symbol.
    Is there any way i can get the value of this field???

    Hi,
    Try the following example
      DATA: i_TAB           LIKE PA0001 OCCURS 0 WITH HEADER LINE,
            l_field(50)     TYPE C,
            l_fieldname(50) TYPE C VALUE 'UNAME'.
      FIELD-SYMBOLS: <fieldxx> TYPE ANY,
                     <valxx>   TYPE ANY.
      ASSIGN l_fieldname TO <fieldxx>.
      SELECT * FROM PA0001 INTO TABLE I_TAB.
      LOOP AT I_TAB.
        CONCATENATE 'I_TAB-' <fieldxx> INTO l_field.
        ASSIGN (l_field) TO <valxx>.
        WRITE <valxx>.
      ENDLOOP.

  • PE8: Can't burn disc from work area only?

    Am I blind? I can't seem to find anywhere an option that will let me burn a disc from the work area only... is it there somewhere?
    I see that option for sharing to the web, but not when burning a disc.
    I have six hours of material on the timeline and was hoping to burn three discs, but PE8 is telling me that I don't have enough disc space for all 6 hours.  Well, duh, I know that, so I was planning on moving the work area over what I wanted to burn, like you can do in PrePro.  No go in PE8?

    Because of a major difference between PrE and PrPro, Sequences, there are things that can be done in PrPro, that PrE cannot do.
    Back in PrPro 2.0, one could Burn to DVD directly. That has not been possible, as of CS3. From there on, one had to either Export/Import from PrPro to Encore, or use Adobe Dynamic Link (strengthened and improved in CS4), to author a DVD/BD.
    Steve's suggestion is the best - use the WAB to Export the segments that are required per DVD, and then do separate Projects for each. Import each DV-AVI that has been Exported, via the WAB, and then just Burn to DVD, for each one. It's two more steps, but gets the job done neatly.
    Good luck,
    Hunt

  • Sap script: Printing the values got from work area in a row

    Hi ,
    I need to print the values which I m getting from a work area like
    A1     A2
    A3     A4
    and so on
    but I m getting it as
    A1
    A2
    A3
    A4.
    Any solutions to this will be highly appreciated.
    Regards,
    Vivek

    Dear vivek,
    how is your work are structure - is it only with single field ?
    In your script after the each value give an extended line comman "=" which will take first and second values for print and after the second value give "line feed" or "carriage return"  command.
    Hope this solves your problem
    Thanks
    venugopal
    Reward accordingly

  • 2 renderers in layout set reading from different areas of km repository

    Good Day
    I have a layout set which contains 2 collection renderers.
    Each renderer must display content from different areas of the km repository in a way that is controlled by the KM Navigation iView parameters "Path to root folder" & "Path to initially displayed folders"
    For example :
    Renderer 1 should display content from the path specified in "Path to root folder"
    and Renderer 2 should display content from the path specified in "Path to initially displayed folder"
    Is this possible? If yes, then how can i do this?
    Renderer 1 is a custom renderer that displays folders almost like in a tree structure.
    Renderer 2 is a EntryPointsCollectionGridRenderer
    Kind Regards
    B

    Hi B
    I don't think you are aware of the use and limitations of the KM Navigation Iview. Have you read the documentation at http://help.sap.com/saphelp_nw04/helpdata/en/b6/29892e91601940bb7a2cd673a1dff5/frameset.htm?
    "When i view the page it only displays the LSROOT layout set. It actually only displays whatever layout set is specified under the parameter "Layout Set for Root Collection". The page does not display LSFOLDER.
    Have i done something wrong?"
    Since I don't know exactly what your layousets consists of and how you have configured the KM Navigation Iview, this is hard to say. But perhaps it is caused by you specifying a path in "Path to initially displayed folder" that is not a subordinate to "Path to root folder for navigation".
    "Would it be possible for LSROOT and LSFOLDER to display contents from different paths in the repository?" Yes, it is possible to display two different paths with two different layout sets. Thats what the "Path to root folder for navigation"/"Layout Set for Root Collection" and "Path to initially displayed folder"/"Layout Set" are for.
    But no, it is not possible to display (merge) the content of two different folders using the KM Navigation Iview. Then you will have to create a taxonomy first or create some other kind of workaround. But I don't know if that was your aim in the first place.
    Kind regards,
    Martin

  • Message 046 from work area SSFCOMPOSER does not exist

    Hi Gurus,
    The above is the error I get when I try Print preview from ME23N. The situation is that the project went just live. While PO printoit is working in QA system, in PROD system the above error comes up.
    In SE91 for both QA and PROD system, I checked for the message class 046 but I didn't see any.
    Pls guide me to what I am missing. Smartform is in both the systems.
    GP

    Hi,
    Actually the error happened be due to the difference in object level between QA and PROD.
    When we did SU53 in PROD system at the time of the error, a partcular object was missing in PROD.
    It is resolved now.
    Thanks.

  • Function module throwing error from work area. Cannot find the problem...

    REPORT  ZPSMARTFORM1.
    tables: zptable1.
    types: begin of ty_zptable1,
          f1 type zf1,
          f2 type zf2,
          f3 type zf3,
    end of ty_zptable1.
    data: itab type table of ty_zptable1 with header line.
    data: wa type ty_zptable1.
    select f1 f2 f3 from zptable1 into table itab.
    CALL FUNCTION '/1BCDWB/SF00000005'
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS         =
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
      USER_SETTINGS              = 'X'
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
      TABLES
        ITAB                       =   .
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    this is my driver program.In my form interface  there are tables,import,export are there where i have to declare tables data.If i am putting wa means it is throwing error.Please show me the clear information.
    Edited by: Julius Bussche on Nov 14, 2008 10:09 AM

    REPORT ZPSMARTFORM1.
    tables: zptable1.
    types: begin of ty_zptable1,
    f1 type zf1,
    f2 type zf2,
    f3 type zf3,
    end of ty_zptable1.
    data: itab type table of ty_zptable1 with header line.
    data: wa type ty_zptable1.
    select f1 f2 f3 from zptable1 into table itab.
    CALL FUNCTION '/1BCDWB/SF00000005'
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    ITAB = .
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Plz for this driver program. Give me the exact solution.I am passing the information like itab  like zptable1 ther ein the smart form table. Even now i am getting error.Here in this driver program i passed itab = itab means .I  am not getting solution.If i have to change any function module name means plz tell me.What i have to put there.Plz give me the correct solution

  • Dynamic read from table  with DBMS_SQL Block

    Hi,
    In the orcale8 Application developer's Guide is this example:
    -- To select everything from this table and move it into four PL/SQL tables, you could use the following simple program:
    c number;
    d number;
    n_tab dbms_sql.Number_Table;
    d_tab1 dbms_sql.Date_Table;
    v_tab dbms_sql.Varchar2_Table;
    d_tab2 dbms_sql.Date_Table;
    indx number := 10;
    begin
    c := dbms_sql.open_cursor;
    dbms_sql.parse(c, 'select * from multi_tab order by 1', EXEC_sql.V7);
    dbms_sql.define_array(c, 1, n_tab, 5, indx);
    dbms_sql.define_array(c, 2, d_tab1, 5, indx);
    dbms_sql.define_array(c, 3, v_tab, 5, indx);
    dbms_sql.define_array(c, 4, d_tab2, 5, indx);
    d := dbms_sql.execute(c);
    loop
    d := dbms_sql.fetch_rows(c);
    dbms_sql.column_value(c, 1, n_tab);
    dbms_sql.column_value(c, 2, d_tab1);
    dbms_sql.column_value(c, 3, v_tab);
    dbms_sql.column_value(c, 4, d_tab2);
    exit when d != 5;
    end loop;
    dbms_sql.close_cursor(c);
    Here the four tables can be used for anything at all. One usage might be to use BIND_ARRAY to move the rows to another table by using a query such as 'INSERT into SOME_T values(:a, :b, :c, :d);
    exception when others then
    if dbms_sql.is_open(c) then
    dbms_sql.close_cursor(c);
    end if;
    raise;
    at the second 'dbms_sql.define_array' comes an ORA-0600 error.
    What's wrong ?

    Some solutions posted here : {message:id=9689485}

  • Inputs read from daq are overwritten

    Hey there
    I have a Daq input reading into a spreadsheet file
    The daq tells me that one is supposed to have a while loop around it, and I can't get it to run without one, so okay
    But my main problem is that this means that it overwrites my written file each time the while loop repeats
    It also asks me to choose the file to write in multiple times
    How would I go about fixing this?
    Thank you
    Solved!
    Go to Solution.

    Yes you can convert numeric to string, check the attached VI. I would recommend you to go through basic LabVIEW materials and also play with NI example which comes with LabVIEW. Remember do not use the attached example along with data acquisition, always use seperate loops.
    The best solution is the one you find it by yourself
    Attachments:
    Write2File.vi ‏19 KB

  • Error to transfer the data from work area to application sevrer file

    Hi,
    I tried to write a file in Application server.
    I tried the below code
    DATA: p_file type char255 VALUE '/H:usr/sap/ccms/test.txt', delimiter TYPE char255 VALUE ' '.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE encoding default.
    LOOP AT itab into wa_itab.
    TRANSFER wa_itab TO p_file.
    ENDLOOP.
    CLOSE DATASET p_file.
    I am getting the below error ,
    "WA_ITAB" cannot be a table, a reference, a string, or contain any of these objects.
    Can anyone let me know ,what is the issue?
    Reagrds,
    Priya

    Hi,
    Well, the message is clear enough you cannot transfer a structured variable as is...
    You could do something like:
           LOOP AT gt_itab ASSIGNING <rec>.
             CLEAR l_text.
             DO.
               ASSIGN COMPONENT sy-index OF STRUCTURE <rec> TO <field>.
               IF sy-subrc = 0.
                 IF sy-index = 1.
                   l_text = <field>.
                 ELSE.
                   CONCATENATE  l_text l_tab <field> INTO l_text.
                 ENDIF.
               ELSE.
                 EXIT.
               ENDIF.
             ENDDO.
             TRY.
                 TRANSFER l_text TO g_file.
               CATCH cx_sy_conversion_codepage INTO l_oref.
               CATCH cx_root INTO l_oref.                     "#EC CATCH_ALL
             ENDTRY.
           ENDLOOP.
    Or, set all components of your table as CHAR.
    Hope it helps,
    Kr,
    m.
    Edited by: Manu D'Haeyer on Sep 27, 2011 12:48 PM

Maybe you are looking for

  • Reading PublicKey from a text file..

    Hi, I generated Public Key using RSA algorithm, and getEncoded() using Base64Encoder, after that I saved it as TEXT file. Here goes the code.      KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");      keyGen.initialize(512); KeyPair key

  • Sales order information in Output text as subject in External Email

    Dear Expert       Request to guide me with the steps involved to configure output text for the information of sales order to be sent to customer via e mail once the order is svaed.

  • JavaScript (Possibly) Help

    Hello all. I need help on a simple script! Basically, I'm trying to make a very easy way to create an automated TEXT menu/index page that builds when a file is added within the same directory. So in theory, if file XXX.swf is added to a folder (root

  • Want a UserExit or a BAdi that gets triggered while saving a PO

    Hi Gurus,   Can anybody help me by telling which UserExit or BAdi gets  triggered while saving a Purchase Order. My requirement is:   While I create a PO using a Purchase Requisition that was created for a Process Order and save it, I want to update

  • No sound from OSX, fine in Windows 7

    I'm having a problem where I am getting no sound from OSX from the internal speakers or headphone jack. Everything is fine in Windows 7 on my bootcamp partition. Im using OSX 10.9.1 on a Macbook pro retina. I don't hear the 'pop' noise when changing