06-17-2015 4:37 PM
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
06-17-2015 5:25 PM
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
06-17-2015 5:16 PM
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
06-17-2015 5:25 PM
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
06-17-2015 6:20 PM
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?