Problem using At Selection Screen on value request for *"Select Fieldname"*
Hi All,
I Have a requirement of passing mutiple paraters value or selection option values in selection screen.
For Eg :I Have -
*--- Selection Screen
Select-options : s1 for vbak-vbeln ,
s2 for vbap-posnr.
*--- At Selection Screen
At Selection Screen on value request for s1-low.
i need to pass S1-low as well as S2-low ...
i.e first item of the Sales Document.
Value is getting passed in S1-low but not in S2-low
Can anybody help me on this ...
Thanks in Advance ..
Hi,
Make use of the FM "F4IF_INT_TABLE_VALUE_REQUEST" for the value request for the first field.
Use the "FIELD_MAPPING" in the tables parameter of the above FM.
Please go through the FM documentation.
Hope this will help you.
Regards,
Smart Varghese
Similar Messages
-
AT SELECTION-SCREEN ON VALUE-REQUEST FOR
Experts,
I have two selection parameters on Selection_Screen as subscreen, as below:
Custom Selection Screen 1010
selection-screen begin of screen 1010 as subscreen.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
SELECT-OPTIONS :
s_matnr FOR mara-matnr MODIF ID sc1, "Material
s_grid FOR mara-J_3APGNR MODIF ID sc6, "Grid values "pkb001
SELECTION-SCREEN END OF BLOCK b2.
selection-screen end of screen 1010.
Now i want to populate s_grid (Grid value) based on the values enterd for s_matnr (material ).
but when i want use:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_grid,
I'm not getting the values eneterd in s_matnr..
is the problem beacuse of subcreen?
Answers are highly appriciated.
Thanks.Yes that is correct, Once I hit enter key, then only the value for s_matnr populates, but it is not a good Idea to expect the user to hit the enter key. is there any way i can imitate/simulate "enter" key in the program?
also I'm using the FM:'DYNP_VALUES_READ' but that is also not getting me any value..
below is the code I'm using,
FORM sub_get_grid .
Refresh: t_mara.
data: lin type i.
data: l_dyname type standard table of dynpread,
w_dynpread type dynpread.
clear w_dynpread.
w_dynpread-fieldname = 'S_MATNR'.
append w_dynpread to l_dyname.
clear w_dynpread.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = l_dyname.
*Do not allow to select more than 1 material at a time.
SELECT
MARA~MATNR
INTO TABLE t_mara
FROM MARA
WHERE MARA~MATNR IN s_matnr.
describe table t_mara LINES lin.
If lin > 1.
Refresh: s_matnr.
MESSAGE i000 WITH text-033.
LEAVE LIST-PROCESSING.
* LEAVE TO SCREEN 100.
endif.
ENDFORM. -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR not input value in input field
Dear All,
I make search help for field ARBPL in selection screen are not excepted selected value.
Code is
SELECT-OPTIONS: p_arbpl FOR zdmde-arbpl MODIF ID two.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_arbpl-low.
REFRESH sh_arbpl.
SELECT * from crhd into CORRESPONDING FIELDS OF TABLE sh_arbpl.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'P_ARBPL'
DYNPROFIELD = 'P_ARBPL'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = sh_arbpl.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_arbpl-high.
REFRESH sh_arbpl.
SELECT * from crhd into CORRESPONDING FIELDS OF TABLE sh_arbpl.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'P_ARBPL'
DYNPROFIELD = 'P_ARBPL'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = sh_arbpl.
Please tell how to input selected field from search help into input field in both low and high.
Would appreciate your reply .
Regards,
PoojaHi Pooja,
For getting the response back from the user selection , please get the return code too. Before that instead of directly using the table crhd structure.. please do create a type declaration of that table , make sure that the field that you wanted to get using search help be specified at last of declaration type like this
TYPES: BEGIN OF ty,
OBJTY TYPE CR_OBJTY,
ARBPL TYPE ARBPL,
END OF ty.
this is because the return parameter t_rtn will holds the last value of type which been selected by user.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'P_ARBPL'
DYNPROFIELD = 'P_ARBPL'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = sh_arbpl
return_tab = t_rtn.
LOOP AT t_rtn INTO x_rtn .
ENDLOOP.
try executing this code.
TABLES crhd.
TYPES: BEGIN OF ty,
OBJTY TYPE CR_OBJTY,
ARBPL TYPE ARBPL,
END OF ty.
DATA: sh_arbpl TYPE TABLE OF ty.
DATA: dynpfields TYPE TABLE OF DYNPREAD,
x_dynpfields TYPE dynpread,
t_rtn TYPE STANDARD TABLE OF DDSHRETVAL ,
x_rtn TYPE DDSHRETVAL.
SELECT-OPTIONS: p_arbpl FOR crhd-ARBPL MODIF ID two.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_arbpl-low.
REFRESH sh_arbpl.
SELECT * from crhd into CORRESPONDING FIELDS OF TABLE sh_arbpl WHERE werks eq '1000'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'P_ARBPL'
DYNPROFIELD = 'P_ARBPL'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = sh_arbpl
return_tab = t_rtn.
LOOP AT t_rtn INTO x_rtn .
ENDLOOP.
x_dynpfields-fieldname = 'P_ARBPL-LOW' .
x_dynpfields-fieldvalue = x_rtn-fieldval.
APPEND x_dynpfields TO dynpfields.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = dynpfields
* EXCEPTIONS
* INVALID_ABAPWORKAREA = 1
* INVALID_DYNPROFIELD = 2
* INVALID_DYNPRONAME = 3
* INVALID_DYNPRONUMMER = 4
* INVALID_REQUEST = 5
* NO_FIELDDESCRIPTION = 6
* UNDEFIND_ERROR = 7
* OTHERS = 8
Regards,
Sivaganesh -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_locat.
Experts,
In BW, does anybody have some simple code for when on your selection-screen you have an input parameter for the location of the file you want to upload. In SAP/R3 there use to be "Perform get_local_path" to drill down thru your hard drive to find the file you want to select to upload. I am not sure what to use in BW to execute a drill down process for getting the file in a drop down window.
Thank-You!Are you trying to browse the local PC or the appliation server.
Implement the program above, give it a try. When you hit F4, you will get a file open dialog, selection your file, then click open, this will fill the pathfile into your parameter on the selection screen. IS this whay you are looking for?
You don't need to provide anything, but you can if you want. There are import parameters.
report zrich_0001.
data: ifile type filetable.
data: xfile like line of ifile.
data: return type i.
parameters: p_file type localfile.
at selection-screen on value-request for p_file.
call method cl_gui_frontend_services=>file_open_dialog
EXPORTING
<b> WINDOW_TITLE = 'Please choose a file'
* DEFAULT_EXTENSION =
DEFAULT_FILENAME = 'Test.xml'
* FILE_FILTER =
INITIAL_DIRECTORY = 'C:'
* MULTISELECTION =</b>
changing
file_table = ifile
rc = return.
read table ifile into xfile index 1.
p_file = xfile-filename.
Regards,
Rich Heilman -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR D
I have four Select options A,B,C,D
For A value is entered
For B value is entered
For C value is entered
For D , i need to create a custom search help.i will develop that in the event
AT SELECTION-SCREEN ON VALUE-REQUEST FOR D.while generating the search help here
i need to access the values that are entered in A,B,C.
Plz any help ?Hi,
You can use the Function module 'F4IF_INT_TABLE_VALUE_REQUEST' to display your custom values in search help. Refer the below sample code on how to use this function module.
REPORT ZTAB_SHELP.
parameters: p_ebeln type ekko-ebeln.
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko,
it_return type STANDARD TABLE OF DDSHRETVAL,
wa_return like line of it_return.
*at selection-screen
at selection-screen on value-request for p_ebeln.
select *
up to 10 rows
from ekko
into CORRESPONDING FIELDS OF TABLE it_ekko.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = 'EKKO'
RETFIELD = 'EBELN'
PVALKEY = ' '
DYNPPROG = sy-repid
DYNPNR = sy-dynnr
DYNPROFIELD = 'EBELN'
STEPL = 0
WINDOW_TITLE = 'Ekko Records'
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = 'X' "allows you select multiple entries from the popup
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET = ld_ret
TABLES
VALUE_TAB = it_ekko
FIELD_TAB = lt_field
RETURN_TAB = it_return
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
READ TABLE it_return into wa_return index 1.
p_ebeln = wa_return-fieldval.
Regards,
Murali
Edited by: murali krishnan Rajendran on Jan 27, 2011 8:03 AM -
Problem in at selection-screen on value request
hi friends ,
i want to display f4 help for a field in a popup. this i can do, but this popup comes based on values
i entered in other screen fields . but these values are not updated to screen values when i trigger f4.Hi,
DATA: T_DYNPRO TYPE TABLE OF DYNPREAD,
WA_DYNPRO LIKE LINE OF T_DYNPRO,
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PARAM.
WA_DYNPRO-FIELDNAME = 'Screen Field Name'.
APPEND WA_DYNPRO TO T_DYNPRO.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-REPID
DYNUMB = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = T_DYNPRO
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE T_DYNPRO INTO WA_DYNPRO WITH KEY FIELDNAME = 'Screen Field Name'.
TEMP = WA_DYNPRO-FIELDVALUE.
" Select the values based on Temp and populate your internal table for F4 help using the Screen value Temp
"Call 'F4IF_INT_TABLE_VALUE_REQUEST' and display the pop up. -
At selection-screen on value-request
Hi experts,
Pls see the below code.
When ever plant is enterd in screen i have to get material no. and material group based on that plant dynamically.
I am getting F4 list of values for the first one.But For the second one i am not getting.
What may be teh problem?
*& Report ZRA_SELECTIONSCTREEN *
REPORT ZRA_SELECTIONSCTREEN .
tables: mara,marc.
parameters: p_werks like marc-werks,
p_matnr like marC-matnr,
p_matkl like mara-matkl.
data: begin of it_matnr occurs 0,
matnr like mara-matnr,
end of it_matnr.
data: begin of it_matkl occurs 0,
matkl like mara-matkl,
end of it_matkl.
at selection-screen on value-request for p_matnr.
select matnr into table it_matnr from marc where werks = p_werks.
if not it_matnr[] is initial.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'MATNR'
PVALKEY = ' '
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'p_matnr'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = it_matnr
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
select matkl from mara into table it_matkl for all entries IN it_matnr
WHERE MATNR = IT_MATNR-MATNR.
if not it_matkl[] is INITIAL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'MATKL'
PVALKEY = ' '
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'p_matkl'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT_MATKL
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
Regards
Ravi.hi
good
i tried your report, f4 help is coming for all the fields but dynamic field selection is ot coming because ther eis a prob with your select statment,
you select the data from the database table for the another two fields as the value you r entering for werks(plant).
thanks
mrutyun^ -
AT SELECTION-SCREEN ON VALUE-REQUEST needed
hi,
i want code for atselection-screen for one parameter.
pls check the code i am sending.i am not understanding that if any one knows pls explain me.and it is correct or not.
parameters: P_LDCTY(2).
DATA: BEGIN OF IHELP_FIELDS OCCURS 20.
INCLUDE STRUCTURE HELP_VALUE.
DATA: END OF IHELP_FIELDS.
DATA: BEGIN OF HELPTAB OCCURS 100,
FELD(50),
END OF HELPTAB.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_LDCTY matchcode object ZSDOTC_VOYAGE.
REFRESH IHELP_FIELDS.
MOVE 'VBAK' TO IHELP_FIELDS-TABNAME.
MOVE 'ZZLOADCTY1' TO IHELP_FIELDS-FIELDNAME.
MOVE 'X' TO IHELP_FIELDS-SELECTFLAG.
APPEND IHELP_FIELDS.
REFRESH HELPTAB.
SELECT *
FROM ZPORT
ORDER BY ZZCNTRY INTO IHELP_FIELDS.
MOVE ZPORT-ZZCNTRY TO HELPTAB.
APPEND HELPTAB.
ENDSELECT.
CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'
EXPORTING
DISPLAY = ' '
FIELDNAME = 'ZZCNTRY'
TABNAME = 'ZPORT'
IMPORTING
SELECT_VALUE = SELECTED_VALUE
TABLES
FIELDS = IHELP_FIELDS
VALUETAB = HELPTAB
EXCEPTIONS
FIELD_NOT_IN_DDIC = 01
MORE_THEN_ONE_SELECTFIELD = 02
NO_SELECTFIELD = 03.
IF SELECTED_VALUE <> SPACE.
P_LDCTY = SELECTED_VALUE.
ENDIF.
pls help mein this issue.
points will be awarded for right answer,
thanks and regards
suneethaHi suneetha,
1. we have to juse like this.
2. a) use FM F4IF_INT_TABLE_VALUE_REQUEST
b) syntax is : AT SELECTION-SCREEN ON VALUE-REQUEST FOR MYFIELD.
3. just copy paste in new program.
4.
Hi prakash,
1. sample code (just copy paste)
2.
REPORT ABC.
DATA : BEGIN OF ITAB OCCURS 0,
UNAME LIKE USR01-BNAME,
END OF ITAB.
data : RETURN_TAB LIKE DDSHRETVAL occurs 0 .
data : RETURN_wa LIKE DDSHRETVAL .
PARAMETERS : A(12) TYPE C.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR A.
ITAB-UNAME = 'U01'. APPEND ITAB.
ITAB-UNAME = 'U02'. APPEND ITAB.
ITAB-UNAME = 'U03'. APPEND ITAB.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'ITAB-UNAME'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'A'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
tables
value_tab = ITAB
FIELD_TAB = FTAB
RETURN_TAB = return_tab
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
break-point.
regards,
amit m. -
AT SELECTION-SCREEN ON VALUE-REQUEST - what has the user entered so far?
Hi,
the online help says to
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_xyz.
With the events for the field and input help, no data is transported between the selection screen and the ABAP program
p_xyz is indeed empty at this event, but is there really no way to find out what the user had entered so far?Did you try a call to FM DYNP_VALUES_READ (Check at [Input Help in Dialog Modules|http://help.sap.com/SAPhelp_nw70/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/frameset.htm])
Regards,
Raymond -
Selection Screen on value request..
Hi,
I have a field called WFA on my selection screen. And I have to populate the login names in that field based on 2 conditions.
To satisfy those two conditions, I have to pullout data from 2 tables.
any help would be appriciated.
Thanks,
Priya.Hi,
You need to write the logic in the <b>INITILIZATION</b> field. there you can write those 2 conditions and move the Sy-Uname to that field
Regards
Sudheer -
Selection screen: no sequence check for select option
Hello everyone,
I am an SAP starter and this will is my first question:
I am making a program that approves a stock demand over several levels. When a level approves, the demand goes to the next level.
for example:
level 1 = planning
level 2 = management
level 3 = buyer
In an overview report i want to choose for which levels i want to see stock demands. But when I make a select option for the level, I cannot choose the range between management and buyer or planning and buyer for example, because it is alphabetically not in the right order. In this case the alfabet is not important but the order of the levels is, so can I prevent this check from happening?
Thank you very muchHi vandersteen,
1. There should be some CODE
for each level.
2. Each code will have some description.
eg. planning, management, buyer
3. So, make select-option
for the FIELD of CODE
(and not the description)
regards,
amit m. -
Selection screen field value capturing
Hi,
I have developed a report for displaying amendment changes in a purchse order. The input are purchase order
and plant. Now they have asked for an additional input of version field, which should also have F4 field-value help.
For version field, default there is no F4 key. So, i have written code like after entering the PO number when we press the enter key, for the corresponding PO, it brings the version no in input field. But my problem is it is displaying the values for version field, but when i select some value it is not getting updated in selection-screen version field. I have attached my code below... please help me
in the below code my problem is only between
AT SELECTION-SCREEN on value-request for P_REVNO.
and
start-of-selection event...
TABLES : ekko,
ekpo,
cdhdr,
cdpos,
MEPO1325,
t001,
t166c,
t166t,
adrc,
komp, " net rate of header
konv, " net value of purchase order
zammendpodet.
TYPES : BEGIN OF ts_cdpos,
ebeln TYPE ekbe-ebeln,
ebelp TYPE ekbe-ebelp,
matnr type ekpo-matnr,
maktx type makt-maktx,
prdat type ekpo-prdat,
belnr TYPE ekbe-belnr,
budat TYPE ekbe-budat,
tkey(70),
txz01 TYPE ekpo-txz01,
ctxnr TYPE t166c-ctxnr,
desp(20) type C,
MEINS LIKE MARA-MEINS,
chtxt TYPE t166t-chtxt.
INCLUDE STRUCTURE cdpos.
TYPES : END OF ts_cdpos.
data : begin of it_makt occurs 0,
matnr like makt-matnr,
maktx like makt-maktx,
end of it_makt.
data : begin of it_maRA occurs 0,
matnr like maRA-matnr,
mEINS like maRA-mEINS,
end of it_maRA.
*Internal table declartion
DATA : it_erev TYPE TABLE OF erev WITH HEADER LINE,
it_ekko1 type table of ekko with header line,
it_konv2 type table of konv with header line,
it_ekpo TYPE TABLE OF ekpo WITH HEADER LINE,
it_ekpo1 TYPE TABLE OF ekpo WITH HEADER LINE,
it_cdhdr TYPE TABLE OF cdhdr WITH HEADER LINE,
it_t166c TYPE TABLE OF t166c WITH HEADER LINE,
it_ekbe TYPE TABLE OF ekbe WITH HEADER LINE,
IT_AMMEND TYPE TABLE OF ZAMMENDPODET WITH HEADER LINE,
IT_AMMEND1 TYPE TABLE OF ZAMMENDPODET WITH HEADER LINE,
it_komp TYPE TABLE OF KOMP WITH HEADER LINE,
it_konv type table of konv with header line,
it_konv1 type table of konv with header line,
it_cdpos TYPE TABLE OF ts_cdpos WITH HEADER LINE.
data : BEGIN OF it_erev1 occurs 0,
revno TYPE erev-revno.
data : end of it_erev1.
data : begin of it_cdpos1 occurs 0.
include structure cdpos.
data : ebeln like ekko-ebeln,
item like ekpo-ebelp,
aedat like ekpo-aedat,
matnr like ekpo-matnr,
txz01 like ekpo-txz01,
desp(20) type C,
MEINS LIKE MARA-MEINS,
item1 like ekpo-netpr.
data : end of it_cdpos1.
types : dy_temp TYPE lips-lgort.
DATA : dyfields LIKE dynpread OCCURS 1 WITH HEADER LINE, dy_value TYPE dy_temp.
DATA: progname TYPE sy-repid,
dynnum TYPE sy-dynnr,
dynpro_values TYPE TABLE OF dynpread,
field_value LIKE LINE OF dynpro_values.
*Work variable declaration
DATA : v_revno TYPE erev-revno,
revno1 type zammendpodet-revno,
w_version TYPE erev-revno,
w_erdat TYPE erev-erdat,
w_eruhr TYPE erev-eruhr,
wv_eruhr TYPE erev-eruhr,
v_tabkey TYPE cdpos-tabkey,
v_temp(5),
v_olddate(8),
v_newdate(8),
v_value_old TYPE cdpos-value_old,
V_OLD TYPE EKPO-BRTWR, " OLD VALUE FOR PURCHASE ORDER
l_ind TYPE i,
temp value 0 type i,
temp1 type i,
temp2 type i,
temp3 type i,
wa_cdpos like line of it_cdpos,
wa_cdpos1 like line of it_cdpos1,
v_tabkey1 TYPE cdpos-tabkey.
PARAMETERS : p_ebeln TYPE ekko-ebeln,
p_ebelp TYPE ekpo-ebelp.
p_bukrs TYPE t001-bukrs,
p_revno type erev-revno.
INITIALIZATION.
AT SELECTION-SCREEN on value-request for P_REVNO.
CLEAR: dyfields[], dyfields.
dyfields-fieldname = 'P_REVNO'.
APPEND dyfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = dyfields.
READ TABLE dyfields INDEX 1.
SELECT revno
FROM erev
INTO TABLE it_erev1 WHERE edokn = p_ebeln.
IF sy-subrc = 0.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'REVNO'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'P_REVNO'
value_org = 'S'
TABLES
value_tab = it_eREV1
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
START-OF-SELECTION.
SELECT SINGLE *
FROM t001
WHERE bukrs EQ p_bukrs.
IF sy-subrc EQ 0.
SELECT SINGLE *
FROM adrc
WHERE addrnumber EQ t001-adrnr.
ENDIF.
SELECT SINGLE *
FROM ekko
WHERE ebeln
EQ p_ebeln
AND frgke = 2.
select * from konv into corresponding fields of table it_konv where knumv eq ekko-knumv.
useful informations will be rewarded.
thanks and regards,
subbu.,Hi ,
Use this function module
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-repid
dynumb = sy-dynnr
tables
dynpfields = t_dynpfields
exceptions
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
others = 8.
where t_dynpfields would contain name of field and value you want to update.
Please reward if useful. -
Hi All,
I am facing a problem with selection screen parameter.
I have one file parameter p_fname TYPE rlgrap-filename OBLIGATORY.When I enter some file path and excute I will get the result and once again when I start to execute the program I expect the previous value(file path) should be available for this file parameter that has entered on the selection screen but I am not getting that.
I dont find any parameter id for this field data element.
Please let me know how to do this?
Best Regards
RameshHi,
You should have..
DATA: FLNAME TYPE STRING.
PARAMETERS: FILENAME TYPE RLGRAP-FILENAME.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILENAME.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = FILENAME.
Find the demo code below, it uses the file :
report ZDS_BDC_MM01_2
no standard page heading line-size 255.
*include bdcrecx1.
*parameters: dataset(132) lower case.
*** DO NOT CHANGE - the generated data section - DO NOT CHANGE ***
* If it is nessesary to change the data section use the rules:
* 1.) Each definition of a field exists of two lines
* 2.) The first line shows exactly the comment
* '* data element: ' followed with the data element
* which describes the field.
* If you don't have a data element use the
* comment without a data element name
* 3.) The second line shows the fieldname of the
* structure, the fieldname must consist of
* a fieldname and optional the character '_' and
* three numbers and the field length in brackets
* 4.) Each field must be type C.
*** Generated data section with specific formatting - DO NOT CHANGE ***
data: begin of record OCCURS 0,
* data element: MATNR
MATNR_001(018),
* data element: MBRSH
MBRSH_002(001),
* data element: MTART
MTART_003(004),
* data element: XFELD
KZSEL_01_004(001),
* data element: MAKTX
MAKTX_005(040),
* data element: MEINS
MEINS_006(003),
* data element: MTPOS_MARA
MTPOS_MARA_007(004),
end of record.
DATA: FLNAME TYPE STRING.
*** End generated data section ***
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
*** MESSAGE******
DATA: BEGIN OF MESSTAB OCCURS 0.
INCLUDE STRUCTURE BDCMSGCOLL.
DATA: MATNR TYPE MARA-MATNR,
END OF MESSTAB.
****END OF MESSAGE****
PARAMETERS: FILENAME TYPE RLGRAP-FILENAME.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILENAME.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = FILENAME.
start-of-selection.
*perform open_dataset using dataset.
perform open_group.
FLNAME = FILENAME.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FLNAME
FILETYPE = 'DAT'
* HAS_FIELD_SEPARATOR = ' '
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* VIRUS_SCAN_PROFILE =
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
DATA_TAB = record
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT record.
DATA:
CNT TYPE I.
CNT = CNT + 1.
REFRESH BDCDATA.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MTART'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
record-MATNR_001.
perform bdc_field using 'RMMG1-MBRSH'
record-MBRSH_002.
perform bdc_field using 'RMMG1-MTART'
record-MTART_003.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
record-KZSEL_01_004.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
record-MAKTX_005.
perform bdc_field using 'BDC_CURSOR'
'MARA-MEINS'.
perform bdc_field using 'MARA-MEINS'
record-MEINS_006.
perform bdc_field using 'MARA-MTPOS_MARA'
record-MTPOS_MARA_007.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
*perform bdc_transaction using 'MM01'.
CALL TRANSACTION 'MM01' USING BDCDATA
MODE 'N'
UPDATE 'A'
MESSAGES INTO MESSTAB.
READ TABLE MESSTAB INTO MESSTAB INDEX CNT.
IF MESSTAB-MSGTYP = 'E'.
MESSTAB-MATNR = RECORD-MATNR_001.
MODIFY MESSTAB INDEX CNT FROM MESSTAB. " TRANSPORTING MATNR.
ENDIF.
ENDLOOP.
FORM OPEN_GROUP.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING CLIENT = SY-MANDT
GROUP = 'MM01'
USER = SY-UNAME
KEEP = 'X'.
ENDFORM.
FORM BDC_INSERT.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'MM01'
* POST_LOCAL = NOVBLOCAL
* PRINTING = NOPRINT
* SIMUBATCH = ' '
* CTUPARAMS = ' '
TABLES
DYNPROTAB = BDCDATA
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
END-OF-SELECTION.
LOOP AT MESSTAB.
IF MESSTAB-MSGTYP = 'E'.
WRITE:/ 'ERROR OCCURED ON MATNR = ',MESSTAB-MATNR , 'MESSAGE : MATNR ALREADY EXISTS IN MARA!!!'.
ENDIF.
ENDLOOP.
perform close_group.
*perform close_dataset using dataset.
*& Form close_group
* text
* --> p1 text
* <-- p2 text
FORM close_group .
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " close_group
*& Form bdc_dynpro
* text
* -->P_0270 text
* -->P_0271 text
FORM bdc_dynpro USING PROGRAM DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-DYNPRO = DYNPRO.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
ENDFORM. " bdc_dynpro
*& Form bdc_field
* text
* -->P_0275 text
* -->P_0276 text
FORM bdc_field USING FNAM FVAL.
IF FVAL <> ' '.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM. " bdc_field
HTH
Regards,
Dhruv Shah -
How to populate 2 screen-fields with one [ON VALUE-REQUEST FOR input] evnt?
I have a selection screen with 2 text inputs - input1, input2.
For the first one I have an "AT SELECTION-SCREEN ON VALUE-REQUEST FOR input1" event.
I successfully get a value there and that is set to the screen field. But I also want input2 to be automatically populated with a value corresponding to the selected input1 (eg. input1=ID, input2=Name).
I'm able to set input2 ABAP variable but not the screen-element.
(I guess that ON VALUE-REQUEST doesn't fire any events for screen fields update, because if I press ENTER after using my search-help, then input2 is set with the right value)
How to solve the problem?Hi Ramchander,
Actually I used FM F4IF_FIELD_VALUE_REQUEST which doesn't have mapping parameters.
But after your advice I looked through F4IF_INT_TABLE_VALUES_REQUEST and found that it's
DYNP_VALUES_UPDATE FM that solves my task.
Thanks! -
Setting multiple parameters in "ON VALUE-REQUEST FOR"
Hello experts,
I have a dynpro with two parameters on it, called PA_LABKY and PA_LABTX. The first field PA_LABKY is extended by a value help (see the code below). Normally when a user chooses a value from f4 help the field is filled with the value. That works correct. Now not the first but both fields PA_LABKY and PA_LABTX should be filled when the user chooses a value from f4 help.
I tried it with following code:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_labky.
get the values from database
SELECT * FROM zrec_001t INTO TABLE lt_rec001t.
set the first output field
CLEAR ls_dynfieldmap.
ls_dynfieldmap-fldname = 'LABKY'.
ls_dynfieldmap-dyfldname = 'PA_LABKY'.
APPEND ls_dynfieldmap TO lt_dynfieldmap.
set the second output field
CLEAR ls_dynfieldmap.
ls_dynfieldmap-fldname = 'LABTX'.
ls_dynfieldmap-dyfldname = 'PA_LABTX'.
APPEND ls_dynfieldmap TO lt_dynfieldmap.
display the f4 help
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
ddic_structure = 'ZREC_001T'
retfield = 'LABKY'
value_org = 'S'
TABLES
value_tab = lt_rec001t
return_tab = lt_returntab
dynpfld_mapping = lt_dynfieldmap
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
the first row contains the value for PA_LABKY
READ TABLE lt_returntab INDEX 1 INTO ls_returntab.
set the value on the dynpro
pa_labky = ls_returntab-fieldval.
the second row contains the value for PA_LABTX
READ TABLE lt_returntab INDEX 2 INTO ls_returntab.
set the value on the dynpro
move ls_returntab-fieldval to pa_labtx. " <--- NOW THAT DOESN'T WORK
It's the last row that doesn't work, it nothing happens with this field. How can I fill that field?
Thanks in advance.
DanielIn order to set the second field you must use the function module DYNP_VALUES_UPDATE. Replace that last statement with a call to this function module, you must pass the parameter name and the value.
Regards,
RIch Heilman
Correct function module name
Message was edited by:
Rich Heilman
Maybe you are looking for
-
Can I use ICal 5.0.3 with Mountain Lion?
Can I use ICal 5.0.3 with Mountain Lion? The new ICal dropped Reminders!
-
How to update standard lookup for name_prefix and name_suffix
We're using Fusion HCM 8. Just at the beginning of some General Setup, we have the need to to add addtional values for name_prefix and name_suiffix. Name_prefix is empty, wehn getting it, in name_Suffix are 3 values. We're using the Setup Option "Man
-
Second screen keeps 'refreshing' at a more frequent rate, now..?
I have my main monitor (HP) running off the mini DVI port and a second monitor running off the mini VGA which is connected to an HDTV. My mini VGA adapter always refreshed periodically with a quick flicker. But recently, the refresh rate increased an
-
Frequency of Message Sending for HTTP/SOAP Receiver
hi, is there a way to schedule a message for a particular time/situation until we get the response from the receiver? Say i am connecting to a https://test.com/OrderReceive, for some reason the receiver has failed to receive the message. Is there a w
-
Unsupported content type in editor
Hi everyone, I just joined the Flex world from the Flash world. I installed the Eclipse plugin and got this error when I tried to open an MXML file. Unsupported content type in editor. Please change the file extension association..blah..blah.. When I