ABAP FORM statement

Hello all,
I need some help in understanding structure of FORM statement.
FORM formA TABLES i_t_data STRUCTURE Z_BIW_KNA1_S.
Can someone explain me the significance of TABLES and STRUCTURE and their usage.
Thanks a lot.

Hi Sachin,
normally you don't need to declare tables in a program. What you need is a work area that might look like a table. This can be done by:
data: wa_kna1 type kna1.
And if you are doing a select you should not use
select * from kna1 ...
you should use
select * into wa_kna1 from kna1 ...
If you need to know more about these programming details you should post your questions in the abap forum.
Hope this helps!
regards
Siggi
Message was edited by: Siegfried Szameitat

Similar Messages

  • ABAP "WRITE" Statements for Debugging

    Just curious to know if one can use ABAP write statements in Update Rules for debugging and auditing, and where the results are actually written to, and if they're accessible via the AWB.
    Thank you.

    Jerry you can write to the monitor from within the update rules.
    The debug message you were going to write out instead go ahead and append your message to the monitor structure.
    FORM compute_data_field
    TABLES   <b>MONITOR</b> STRUCTURE RSMONITOR  
    USING    COMM_STRUCTURE LIKE /BIC/CS8ZTESTODS
             RECORD_NO LIKE SY-TABIX
             RECORD_ALL LIKE SY-TABIX
             SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
    CHANGING RESULT LIKE /BIC/VZTESTCUBT-INVCD_QTY
             RETURNCODE LIKE SY-SUBRC
             ABORT LIKE SY-SUBRC.
    You will then be able to view any messages you have added to the monitor in the monitor.
    Hope this helps.
    Cheers

  • FAQ's, intros and memorable discussions in the ABAP Form Printing Forum

    Welcome to the SDN ABAP Form Printing Forum!
    In addition to release dependent information avalaible by:
    - pressing the F1 key on an ABAP statement,
    - or searching for them in transaction ABAPDOCU,
    - using the [SDN ABAP Development Forum Search|https://www.sdn.sap.com/irj/sdn/directforumsearch?threadid=&q=&objid=c42&daterange=all&numresults=15&rankby=10001],
    - the information accessible via the [SDN ABAP Main Wiki|https://wiki.sdn.sap.com/wiki/display/ABAP],
    - the [SAP Service Marketplace|http://service.sap.com] and see [SAP Note 192194|https://service.sap.com/sap/support/notes/192194] for search tips,
    - the 3 part [How to write guru ABAP code series|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f2dac69e-0e01-0010-e2b6-81c1e8e5ce50] ... (use the search to easily find the other 2 documents...)
    ... this "sticky post" lists some threads from the ABAP forums as:
    - An introduction for new members / visitors on topics discussed in threads,
    - An introduction to how the forums are used and the quality expected,
    - A collection of some threads which provided usefull answers to questions which are frequently asked, and,
    - A collection of some memorable threads if you feel like reading some ABAP related material.
    The listed threads will be enhanced from time to time. Please feel welcome to post to [this thread|Suggestions thread for ABAP FAQ sticky; to suggest any additional inclusions.
    Note: When asking a question in the forum, please also provide sufficient information such that the question can be answered usefully, do not repeat interview-type questions, and once closed please indicate which solution was usefull - to help others who search for it.
    Form Printing
    Exporting Graphics from SAP => Download Logo from SE78, except WS_DOWNLOAD has been replaced (see the docs).
    How to check via report if a graphic exist in SE78. => Validating the existence of a graphic from ABAP.

    Welcome to the SDN ABAP Form Printing Forum!
    In addition to release dependent information avalaible by:
    - pressing the F1 key on an ABAP statement,
    - or searching for them in transaction ABAPDOCU,
    - using the [SDN ABAP Development Forum Search|https://www.sdn.sap.com/irj/sdn/directforumsearch?threadid=&q=&objid=c42&daterange=all&numresults=15&rankby=10001],
    - the information accessible via the [SDN ABAP Main Wiki|https://wiki.sdn.sap.com/wiki/display/ABAP],
    - the [SAP Service Marketplace|http://service.sap.com] and see [SAP Note 192194|https://service.sap.com/sap/support/notes/192194] for search tips,
    - the 3 part [How to write guru ABAP code series|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f2dac69e-0e01-0010-e2b6-81c1e8e5ce50] ... (use the search to easily find the other 2 documents...)
    ... this "sticky post" lists some threads from the ABAP forums as:
    - An introduction for new members / visitors on topics discussed in threads,
    - An introduction to how the forums are used and the quality expected,
    - A collection of some threads which provided usefull answers to questions which are frequently asked, and,
    - A collection of some memorable threads if you feel like reading some ABAP related material.
    The listed threads will be enhanced from time to time. Please feel welcome to post to [this thread|Suggestions thread for ABAP FAQ sticky; to suggest any additional inclusions.
    Note: When asking a question in the forum, please also provide sufficient information such that the question can be answered usefully, do not repeat interview-type questions, and once closed please indicate which solution was usefull - to help others who search for it.
    Form Printing
    Exporting Graphics from SAP => Download Logo from SE78, except WS_DOWNLOAD has been replaced (see the docs).
    How to check via report if a graphic exist in SE78. => Validating the existence of a graphic from ABAP.

  • Where to do the abap sql statement in sapscript (PO)

    Hi, all.
    Hope anybody can guide me to find a solution.
    My situation now is i have to do a purchase order in SAPSCRIPT starting from a standard po. I already found out all the related details as below:
    Program           SAPFM06P
    FORM routine      ENTRY_NEU
    Form              MEDRUCK
    So, now the problem now is I have to add some more data on my print out PO. After figure out for some time, I don't know where to do my abap sql statement. Like example, I want to retriece some data from the ADRC table. I opened the standard program SAPFM06P to add in the some sql statement, but i dun know where should i add in. Bcz if we straight away put the related ADRC field in our sapscript, it is useless, right?
    Thanks in advance.

    Thanks a lot.
    So, how should i add in code in order to fetch the data frm ADRC by using that routine. Because i only the codes like below. I don't where should i start add in.
    Form entry_neu using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      if nast-aende eq space.
        l_druvo = '1'.
      else.
        l_druvo = '2'.
      endif.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      call function 'ME_PRINT_PO'
           exporting
                ix_nast        = l_nast
                ix_druvo       = l_druvo
                doc            = l_doc
                ix_screen      = ent_screen
                ix_from_memory = l_from_memory
                ix_toa_dara    = toa_dara
                ix_arc_params  = arc_params
                ix_fonam       = tnapr-fonam          "HW 214570
           importing
                ex_retco       = ent_retco.
    endform.
    Or i come wrong place to add in any coding. Plz guide me.
    Thanks in advance.

  • EHP5 - Dump in WD ABAP form link in Portal

    Hi Experts,
    EHP5 has been upgraded in Portal.
    Now whenever we are clicking any WD ABAP form link in Team Dashboard we are getting the following dump------
    'An exception occurred that was caught'.
    When we debugged the WD ABAP code we found the error in 'runtime->execute()' in the standard mehod 'Handle_Request()
    in the standard class 'CL_WDR_CLIENT_ABSTRACT_HTTP' .
    When EHP4 was there we were not getting such error but after the upgrdation of EHP5 we are getting this kind of dump.
    Can you please provide the solution to resolve such kind of dump in EHP5?
    Regards,
    Anindita

    Does it crash when "arriving" at the method and trying to execute the implementation (bad parameters?) or does it crash with in the handle_request itself? If it crashes within the method, can you debug to the point where the dump actually occurs?
    Cheers, Lukas

  • How to insert an Active X control in a ABAP form

    Hi All,
        I am learner, want to embed an Active X control in ABAP form, and how can i communicate from Active X control to ABAP form. if you refer screen shots it will be great.
    Thanks & Regards
    Chandra

    check this weblog.
    <a href="https://weblogs.sdn.sap.com/pub/wlg/995">Using Classic ActiveX Controls in the ABAP Control Framework</a>
    In future kindly post ABAP related questions in ABAP forum.
    Raja

  • Perform and Form statements

    Hello,
    can anyone give egs of using PERFORM and FORM statement. what do these statements do actually.
    thanks.

    See this sample for PERFORM ... USING...CHANGING
    DATA : c1 TYPE i, c2 TYPE i, res TYPE i.
    c1 = 1.
    c2 = 2.
    <b>PERFORM sum USING c1 c2 CHANGING res.</b>
    WRITE:/ res.
    **& Form sum
    ** text
    form sum using p_c1 p_c2 changing value(p_res).
    p_res = p_c1 + p_c2.
    endform. " sum
    Note the difference between the above and below perform.
    DATA : c1 TYPE i, c2 TYPE i, res TYPE i.
    c1 = 1.
    c2 = 2.
    <b>data: subroutinename(3) VALUE 'SUM'.
    PERFORM (subroutinename) IN PROGRAM Y_JJTEST1 USING c1 c2 CHANGING res</b>.
    WRITE:/ res.
    **& Form sum
    text
    form sum using p_c1 p_c2 changing value(p_res).
    p_res = p_c1 + p_c2.
    endform. " sum
    ANother sample for simple perform
    PERFORM HELP_ME.
    FORM HELP_ME.
    ENDFORM.
    <b>... TABLES itab1 itab2 ...</b>
    TYPES: BEGIN OF ITAB_TYPE,
             TEXT(50),
             NUMBER TYPE I,
           END OF ITAB_TYPE.
    DATA:  ITAB TYPE STANDARD TABLE OF ITAB_TYPE WITH
                     NON-UNIQUE DEFAULT KEY INITIAL SIZE 100,
           BEGIN OF ITAB_LINE,
             TEXT(50),
             NUMBER TYPE I,
           END OF ITAB_LINE,
           STRUC like T005T.
    PERFORM DISPLAY TABLES ITAB
                    USING  STRUC.
    FORM DISPLAY TABLES PAR_ITAB STRUCTURE ITAB_LINE
                 USING  PAR      like      T005T.
      DATA: LOC_COMPARE LIKE PAR_ITAB-TEXT.
      WRITE: / PAR-LAND1, PAR-LANDX.
      LOOP AT PAR_ITAB WHERE TEXT = LOC_COMPARE.
      ENDLOOP.
    ENDFORM.
    Hope this helps.
    Reward points if this helps u.

  • Can a system-variable passed in the The syntax of the FoRM statement

    The syntax of the FoRM statement is
    FORM {TABLES <t1><t2><t3>......} {USING <U1><U2><U3>.....} {CHANGING <C1><C2><C3>.....}
    ENDFORM .
    As all these are vvariables can a system-variable passed here
    ---if not why?

    Hi,
      Why do you need to pass the system variable to the form at the first place ? It would not be a good programming practice to pass a system variable to the form.
    Hope this helps..
    Thanks in advance,
    Harikrishna.

  • Find perform statement in MB1B which is calling Form statement in Zprogram

    Hi,
    we written form statement in zprogram, it is called in MB1B transaction.this linked
    to one output type.my problem is how to find  perform statement in MB1B.
    Do help at earliest.
    Thanks in advance.
    Rama.
    SAP-Techincal consultant.

    Thanks for reply.
    in zprogram we have been updating ztables.problem here is even we set break point here, cursor  not coming into that subroutine when we run transaction MB1B.
    CAN U PLZ say how to stop execution in subroutine.
    YOURS
    RAM

  • Comparison between ABAP command statements in different versions

    Hi,
    I'm looking for information on version wise difference in ABAP statements. Can someone provide help in this area.
    I need a list of Commands along with there syntax in different versions of ABAP (ECC 5.0 and 4.7).
    Is there any system table where this information is maintained?
    Regards,
    Gajendra Bhatt

    Hi Gajendra ,
    I doubt if SAP has some document which shows the history of all ABAP commands as to how they behaved in which version. The only option you have is go through the following notes and compile the info manually -
    0000178452 Release upgrade from 4.0 to 4.5 for customers prog
    0000452229 Release upgrade from 6.10 to 6.20 for customer pro
    0000178725 Release upgrade from 4.5 to 4.6 for customer progr
    0000689951 Release upgrade from 6.20 to 6.40 for customer pro
    0000178482 Rel. upgrade from 3.0 to 4.0 for customer programs
    0000857904 0003 0.460 Upgrade from Release 6.40 to 7.0: Customer program
    0000367676 0061 0.450 Release upgrade from 4.6 to 6.10 for customer prog
    0000099025 0004 0.340 Change from 4.0A/B to 4.5A for customer programs 
    Cheers.

  • ABAP select statements takes too long

    Hi,
    I have a select statement as shown below.
    SELECT * FROM BSEG INTO TABLE ITAB_BSEG
                         WHERE  BUKRS = CO_CODE
                         AND    BELNR IN W_DOCNO
                         AND    GJAHR = THISYEAR
                         AND    AUGBL NE SPACE.
    This select statement runs fine in all of R/3 systems except for 1. The problem that is shown with this particular system is that the query takes very long ( up to an hour for if W_DOCNO consists of 5 entries). Sometimes, before the query can complete, an ABAP runtime error is encountered as shown below:
    <b>Database error text........: "ORA-01555: snapshot too old: rollback segment   
    number 7 with name "PRS_5" too small?"                                       
    Internal call code.........: "[RSQL/FTCH/BSEG ]"                              
    Please check the entries in the system log (Transaction SM21).  </b> 
    Please help me on this issue. However, do not give me suggestions about selecting from a smaller table (bsik, bsak) as my situation does not permit it.
    I will reward points.

    dont use select * ....
    instead u declare ur itab with the required fields and then in select refer to the fields in the select .
    data : begin of itab,
             f1
             f2
             f3
             f4
             end of itab.
    select f1 f2 f3 f4 ..
         into table itab
    from bseg where ...
    . this improves the performance .
    select * is not advised .
    regards,
    vijay

  • ABAP - CASE STATEMENT - How to get out of WHEN statement??

    Hi ABAP experts,
    I am implementing an User exit related to inbound Sales order.
    All my IDoc contain,  E1EDP02 001
                                   E1EDP02 002 segments.
    Case w_e1edp02-qualf.
    when '001'
    clear lv-tabix.
    lv-tabix = sy-tabix + 1.
    Read int_edidd into wa_edidd index lv_tabix.
    if wa_edidd-segnam = 'E1EDP05'
    if wa-e1edp05-qualf = '002'  " Always this is giving the current segment data. when i debug, it is showing QUALF = '001'. What should i do here to get the next segment data.
    EXIT.
    else.
    <statements>.
    endif.
    when '002'.
    <statements>.
    endcase.
    Can anyone tell me what should i do in the first WHEN statement to check the next segment qualifier.
    Thanks and Waiting for your answer.
    Regards,
    Creasy Matt

    ur question is not clear...
    Case w_e1edp02-qualf.
    when '001'
    clear lv-tabix.   
    lv_tabix = lv_tabix + 1.   "seems u want to loop wa_edidd
    Read int_edidd into wa_edidd index lv_tabix.
    if wa_edidd-segnam = 'E1EDP05'
    if wa-e1edp05-qualf = '002'  "            "is it the correct work area????
    EXIT.
    else.
    <statements>.
    endif.
    when '002'.
    <statements>.
    endcase.
    i think u can do like dis...
    Case w_e1edp02-qualf.
    when '001'
    LOOP AT int_edidd into wa_edidd .
    if wa_edidd-segnam = 'E1EDP05'
    if wa-edidd-qualf = '002'           
    EXIT.
    else.
    <statements>.
    endif.
    ENDLOOP.

  • Adobe Muse - Contact Forms State not changing

    Hey. So I've been playing around with Muse's contact form and changing the aesthetics of the forms (rounded corners, size, text color etc) up to when I came to changing the State of the contact boxes. They seem to show to work perfectly fine in the design mode when you check all rollover states, but when you preview the site in the browser or even in Muse's Preview mode, the changes don't seem to be exactly how you thought they would be. Specifically, I changed the alignment of the text in the box from left to centered, yet the normal state keeps it left (and italicized, which is default). Anyone know the fix to this?

    Like I said, I made sure I changed all the states to the ones that I wanted yet the preview doesn't show the states as I wanted. My text box has left aligned text when i've made sure to center it several times.
    This is what it looks like in the design mode in Muse. (Don't mind the Email/Password, I'm just designing, not for functionality.)
    This is what it looks like once previewed in a browser. Upon clicking and submitting the text aligns in left as well.

  • ABAP - Case Statement

    Hi ABAPers,
    I have an ABAP code just like the pseudo code below.
    Case Val.
    When 'A'.
    <Some Conditional Statements>.
    When 'B'.
    <Some Statements>.
    endcase.
    A and B values are depend on 'Val'.
    My program executes the above code almost everytime. when the conditional statement of Case (A) is successful, then I dont want my program to execute the case(B).
    When the conditional statement of case(A) is unsuccessful, then only i want to execute case (B). Can anyone please tell me how to correct my code to suit the above situation.
    Thanks,
    Creasy Matt
    Edited by: Vijay Babu Dudla on Jan 19, 2009 11:20 PM

    Why case statement does  not support for small alphabet letters ( a, b, c,..z) ?
    here i have attached some code .. this is not working for small letters but works for caps letter.
    what is the reason . ?
    PARAMETERS: uname(10) TYPE C.
    CASE uname.
       WHEN 'karthi'.  " but work for caps letter . when 'KARTHI'.
         WRITE: ' user name is' ,uname.
       WHEN OTHERS.
         WRITE 'Your name is not karthi'.
    ENDCASE.
    Thank you friends

  • ABAP Forms - Number of Copies

    Hello,
    I am having problems with a form that I created in SAP.  The form is for a barcode label.  The only contents of the form is a text include and a call to an external report that pulls in data.  When I call the form from a program that I wrote it always prints two copies.  However when the form is called via MIGO, it only prints one copy.  Does anyone know what could cause this?  I have looked at the number of copies field in the itcpo that I pass the OPEN_FORM function routine.  Any help would be appreciated

    Hi Ryan,
            Since you are getting two copies of same output, right. I suggest you to run the program in debug mode to see what actually happens during run time. Check simultaneously the way the program runs and the status of the list where the contents gets printed. You may come up with a solution. For debugging check this thread...
    Re: DOCUMENT_NOT_FOUND
    Hope this helps.
    Kindly, Reward points if it helps by clicking the star
    in the left hand side of the screen.
    Regards,
    Maheswaran.B

Maybe you are looking for

  • Pages, Numbers and Keynotes doesn't allow me to save documents

    I created a new document in pages, numbers or keynote and, when trying to save it to my documents folder, it shows me "Couldn't auto-save document". I've tried with different folders with the same results. There's no problem when saving to iCloud. I

  • Firefox will display hotmail e-mail inbox, but will not open them

    Firefox will be able to load Hotmail and display your inbox- but will not respond when clicking on any emails, options like new and reply, or junk mail and other folders. The mouse works fine with all other programs and Hotmail runs as normal on othe

  • IllegalStateException error

    why does this program give me an IllegalStateException when I run it? How can it be fixed? import java.util.*; import java.io.*; import javax.swing.*; public class FileChooser extends javax.swing.JFrame     private final int POINTS = 1600;        jav

  • Reappearing date in datefield itemRenderer of DataGrid

    Hello, I have a datagrid with an item renderer on one column, which is a datefield. The column (and the whole datagrid) is linked to a MySQL db. when you edit a column it edits the db real time. My problem is that when i delete a date from the datefi

  • Student Membership is $29.99 now?

    When I signed up for Creative Cloud last year I was put at $19.99 a month for my plan. But, Now that it auto-renewed it is set at $29.99 when I see the price at $19.99. Why am I being charged an extra $10.00?