Skip to Content
author's profile photo Former Member
Former Member

How can we make a call to the Data base in the SAP Scripts?

Hi All,

How we make a call to the data base in scripts?

I think we can use the PERFORM statement to achieve the above functionality.

Pls correct me if i am wrong?

Regards

Abhilash.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 04:22 PM

    Hello.

    If you want to access database in the script itself (not in print program) yes, you can use PERFORM statement.

    In your script, use:

    /: PERFORM F_FORM IN PROGRAM ZRFIRFS05

    /: USING &VAR1&

    /: CHANGING &VAR2&

    /: ENDPERFORM

    Then, create a program ZPROG (ZRFIRFS05 in my case) with a structure like this one:

    REPORT ZRFIRFS05 .
    
    FORM f_form TABLES in_par STRUCTURE itcsy out_par STRUCTURE itcsy.
    
      DATA: l_data1(10).
    
      READ TABLE in_par WITH KEY name = 'VAR1'.
      CHECK sy-subrc = 0.
      l_data1 = in_par-value.
    
    *  SELECT .... "YOUR SELECT TO DATABASE
    
      READ TABLE out_par WITH KEY name = 'VAR2'.
      CHECK sy-subrc = 0.
      out_par-value = l_data3.
    
      MODIFY out_par INDEX sy-tabix.
    
    ENDFORM.
    

    Regards.

    Valter Oliveira.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 17, 2008 at 04:23 PM

    Yes you can use the command PERFORM ... ENDPREFORM to achieve this.

    Pass the selection fields by USING addition

    and receive the fields by CHANGING addition

    Check this:

    http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm

    Regards,

    Naimesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 04:26 PM

    Hi Valter,

    Thanks for the reply.

    Regards.

    Abhilash

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.