Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAP script display text dynamically

former_member184741
Active Contributor
0 Kudos

Hi,

I have a requirement where I need to display some text in the SAp script form based on custom logic. I have to do a select on a custom table and based on the result I have to display some text. How do I do that? where should i write the select statement and how to dsiplay/not-display the text in SAP script?

thanks

1 ACCEPTED SOLUTION

Hvshal4u
Active Participant
0 Kudos

Hi Sankara,

Is it Standard script or custom ?

If it is standard then you have to write the SELECT statement in the FORM routines .For this you have to open the window in which you want to add the custom field & add call the subroutines using

PERFORM GET_DATA IN PROGRAM ZPROGRAM_NAME USING &LV_VAR1& CHANGING &LV_VAR2&

ENDPERFORM.

Now create the ZPROGRAM_NAME in se38

using the form :

FORM get_data TABLES intable STRUCTURE itcsy

                      outtable STRUCTURE itcsy.


Write your logic to fetch data from the custom table in this form routine.


Regards-

Vishal

3 REPLIES 3

naimesh_patel
Active Contributor
0 Kudos

If you're driver program is standard and are you are not changing it, You can write your logic in the Subroutine in the different program and call it in the SAPScript window using the PERFORM statement

Calling ABAP Subroutines: PERFORM - BC Style and Form Maintenance - SAP Library

If you have custom program and custom SAPScript, you can simply do the select before calling the text element of that window, assign the value in the global variable and use that in the SAPScript.

Regards,
Naimesh Patel

Hvshal4u
Active Participant
0 Kudos

Hi Sankara,

Is it Standard script or custom ?

If it is standard then you have to write the SELECT statement in the FORM routines .For this you have to open the window in which you want to add the custom field & add call the subroutines using

PERFORM GET_DATA IN PROGRAM ZPROGRAM_NAME USING &LV_VAR1& CHANGING &LV_VAR2&

ENDPERFORM.

Now create the ZPROGRAM_NAME in se38

using the form :

FORM get_data TABLES intable STRUCTURE itcsy

                      outtable STRUCTURE itcsy.


Write your logic to fetch data from the custom table in this form routine.


Regards-

Vishal

0 Kudos

hi,

I am coying standard form MEDRUCK into a Z one. I have also copied the driver program YFM06PE02 into a Z one. it has form entry_neu, where SAP calls 'ME_PRINT_PO' which does all the work. I can not change this FM. What should I do?