06-05-2008 3:59 PM
This is regarding variant population.
I need to populate values in selection screen fields of one program (program 2)by calling from another executable ABAP program(.Program 1)
I can identify the variant that i need ot populate.But there is a pushbutton in the selection screen of Program 2 which on clicking leads to some more fields in a pop up screen.How can I populate values in those fields there ?Please help.
Thanks & Regards,
Savitha
06-05-2008 4:04 PM
Hi
bydefault display all the fields of the program 2, based on the condition pass only those field which are applicable to the condition.
use submit via selection screen.
or else u can export the selection screen field in program1 and import those field in the program2 INITIALIZATION part.
hope this will help u
06-05-2008 4:09 PM
I got a problem like that, then I tried to do a BDC, but it doesn't accept BDC's so I made a vbs program. This could help:
FORM exec_vbs .
DATA:BEGIN OF it_file OCCURS 0,
line TYPE string,
END OF it_file.
DATA:filename TYPE string.
CLEAR it_file[].
it_file-line = 'msgbox "Variant will be updated, please don''t move or minimize the screen"'.
append it_file.
it_file-line = 'Dim objShell:Set objShell = CreateObject("WScript.Shell")'.
append it_file.
it_file-line = 'do while(ObjShell.AppActivate("R/A Settlements")=FALSE)'.
append it_file.
it_file-line = ' wscript.sleep 2000'.
append it_file.
it_file-line = 'loop'.
append it_file.
it_file-line = 'wscript.sleep 500:ObjShell.SendKeys "%ye":wscript.sleep 1999'.
append it_file.
it_file-line = 'do while(ObjShell.AppActivate("SAP Easy Access")=FALSE)'.
append it_file.
it_file-line = ' wscript.sleep 1000'.
append it_file.
it_file-line = 'loop'.
append it_file.
it_file-line = 'ObjShell.SendKeys "cj8g":wscript.sleep 940:ObjShell.SendKeys ""'. append it_file. it_file-line = 'wscript.sleep 1500'. append it_file. it_file-line = 'do while(ObjShell.AppActivate("Actual Settlement")=FALSE)'. append it_file. it_file-line = ' wscript.sleep 1000'. append it_file. it_file-line = 'loop'. append it_file. it_file-line = 'wscript.sleep 1950'. append it_file. it_file-line = '''controlshiftF7'. append it_file. it_file-line = 'ObjShell.SendKeys "^+":wscript.sleep 3100'. append it_file. it_file-line = '''shift+F2'. append it_file. it_file-line = 'ObjShell.SendKeys "+":wscript.sleep 2199'. append it_file. it_file-line = '''shift+F10'. append it_file. it_file-line = 'ObjShell.SendKeys "+":wscript.sleep 500:''SCROL DOWN'. append it_file. it_file-line = 'for x = 1 to 2: ObjShell.SendKeys "":wscript.sleep 500:next'. append it_file. it_file-line = ' wscript.sleep 500:ObjShell.SendKeys "":Wscript.Sleep 950'.
append it_file.
it_file-line = '''shift+F4'.
append it_file.
it_file-line = 'ObjShell.SendKeys "+":Wscript.Sleep 1999:ObjShell.SendKeys "+
"'.
append it_file.
clear it_file-line.
concatenate 'Wscript.Sleep 500:ObjShell.SendKeys "' TEMP_FOLDER '\Worksheet.txt' '"' into it_file-line.
append it_file.
it_file-line = 'Wscript.Sleep 400:ObjShell.SendKeys "":Wscript.Sleep 2500:ObjShell.SendKeys "":Wscript.Sleep 1900'.
append it_file.
it_file-line = 'ObjShell.SendKeys "^s":Wscript.Sleep 2900'.
append it_file.
it_file-line = 'ObjShell.SendKeys "+":Wscript.Sleep 1200'.
append it_file.
it_file-line = 'ObjShell.SendKeys "+":Wscript.Sleep 1200'.
append it_file.
it_file-line = 'ObjShell.SendKeys "%"'.
append it_file.
it_file-line = 'Wscript.Sleep 1700'.
append it_file.
concatenate TEMP_FOLDER '\settle.vbs' into filename.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = filename
TABLES
data_tab = it_file.
CALL FUNCTION 'WS_EXECUTE'
EXPORTING
PROGRAM = filename.
IF SY-SUBRC <> 0.
ENDIF.
06-05-2008 4:12 PM
Hello,
I suggest you to use the call transaction with bdc. To get the mapping go to transaction SHDB .
DATA class_name TYPE c LENGTH 30 VALUE 'CL_SPFLI_PERSISTENT'.
DATA: bdcdata_wa TYPE bdcdata,
bdcdata_tab TYPE TABLE OF bdcdata.
DATA opt TYPE ctu_params.
CLEAR bdcdata_wa.
bdcdata_wa-program = 'SAPLSEOD'.
bdcdata_wa-dynpro = '1000'.
bdcdata_wa-dynbegin = 'X'.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'BDC_CURSOR'.
bdcdata_wa-fval = 'SEOCLASS-CLSNAME'.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'SEOCLASS-CLSNAME'.
bdcdata_wa-fval = class_name.
APPEND bdcdata_wa TO bdcdata_tab.
CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'BDC_OKCODE'.
bdcdata_wa-fval = '=CIDI'.
APPEND bdcdata_wa TO bdcdata_tab.
opt-dismode = 'E'.
opt-defsize = 'X'.
CALL TRANSACTION 'SE24' USING bdcdata_tab OPTIONS FROM opt.
Regards.
06-05-2008 4:21 PM
Hi,
Is this not possible if we populate ranges for select options and parameters in calling program and then use SUBMIT?
thnx,
ags.
06-05-2008 4:39 PM
06-05-2008 5:25 PM
1) Only the variants of the second program need to be populated with values fro first program.
2) Program 2 should not get executed immediately.The program 2 will be executed at a later point.
3) variant of the program 2 is decided and soem fields in a popup screen as a result of button action have to be populated from program 1.Can we populate the field sin the pop up screen way ahead from the program one using variant info?
Thanks & Regards,
Savitha
06-05-2008 5:38 PM
Hi,
You can use submit statement in your program1 to pass values to program2.
SUBMIT program2
WITH selection_parameter EQ value
WITH radio_button_name EQ 'X'
WITH selection_parameter IN value
WITHOUT SPOOL DYNPRO
AND RETURN.
Example :
SUBMIT ZMDTRAIL
WITH P_BUKRS EQ VBRK-BUKRS
WITH S_VBELN EQ VBRK-VBELN
WITHOUT SPOOL DYNPRO
AND RETURN.
If you use WITHOUT SPOOL DYNPRO addition than you wont get a popup of selection screen of program2 and values will be directly passed there.