Clear Screen Field
Dear Friends
I have a Screen and 6 drop down boxes are there with different table references.
I have use PROCESS ON VALUE-REQUEST block for the getting there serch help values with use FM 'F4IF_INT_TABLE_VALUE_REQUEST'
my question is when i select One drop down belows are must be clear. that means
if I select Drop down 2 ==== Drop down 3,4,5,6 must be clear
if I select Drop down 5 ==== Drop down 5,6 must be clear
i use in PAI event like CLEAR <Field Name> but its not working
Can you anyone give me a solution to clear this issue
Thanks and Regards
Have a search through the ABAP UI forum for function module 'DYNP_VALUES_UPDATE' examples - you can use this in the way you want to update the value of other screen fields during a POV event i.e. in the F4 for another field.
If you scroll down through:
Re: getting the description
you'll see an example I posted of using this to set text for an associated field, but clear (set to space) should work equally well.
Jonathan
Similar Messages
-
Module Pool clear screen field
Hi,
I have a screen i fetch the data to it and process the screen data to do GR.
Problem is for one field, screen retaining the old transaction data. All the time user happen to come out of the transaction and transact again to get the proper value.
i suspect it is becasu eof screen cache..
Does anyone faced this kind of problem?Hi,
In the PBO ofthe screen, give CLEAR statement for the particular screen field,
or give a pushbutton 'reset' and write the following in PAI..
WHEN 'RESET'. "Resets the input ields in the screen
CLEAR t5.
CLEAR t6.
CLEAR t7.
CLEAR t8.
endcase.
where,
t5,t6,t7,t8 are input fields.
hope this helps u,
Arunsri -
How to clear the fields of the screen ?
Hi,
I'm having two fields for selection..when i press enter after entering some values,based on that my table control will get filled up..and when i double -click on that row in table control i get all the values of that row in the respective fields in my tabstrip..all these r in same screen 100..and in tabstrip i have 5 tabs with 5 subscreens..containing the fields of table control..now that when i enter a value in the selection screen fields..my table control is getting added with a second row of values as required..but my problem is that the values of the tabstrip should get cleared..this is not happening..i wrote logic like if my tablecontrol is getting appended the values from tabstrip should get cleared..all the fields are getting cleared except the fields of tab which is active..how to do it..Hi,
Try this out.
declare a variable in Top Include
data : appended type c.
if the appending to the internal table is success means sy-subrc = 0
make appended = 'X'.
go to the PBO of subscreen of the tab where you want to clear the data
if appended = 'X'.
clear appended.( this is must otherwise for every call of the subscreen of this tab the values get cleared)
here clear the value of the subscreen of the tab strip)
endif.
The same can be achieved using the OK_CODE also
Regards
Ramchander Rao.K -
Hello all,
How to clear the fields content from a selection-screen when the user returns from report to sel.screen?
I try in PBO for selection screen to clear all the fields, works fine but with one exception, when it is pressed Enter,
all the fields contents are empty.
Thank you
BogdanHi Bogdan,
i think you can achieve this with a flag and export/import to SAP-memory:
AT SELECTION-SCREEN OUTPUT.
IMPORT back FROM MEMORY ID 'back'.
IF back = 'X'.
*clear/refresh your sel-opt/param.
refresh gjahr.
CLEAR : gjahr , amount.
CLEAR back.
FREE MEMORY ID 'back'.
ENDIF.
START-OF-SELECTION.
*end of your program
back = 'X'.
EXPORT back TO MEMORY ID 'back'.
Andreas -
How to skip the mandatory field validation for clearing the screen fields
Hi Friends,
I have created a module pool screen, and made some fields mandatory. after entering some fields, if i try to clear the fields, am unable to clear. Its throwing the error "Enter all required fields"., since some mandatory fields are there. But i could able to navigate through other screen. Both the "CLEAR" and "NEXT" command are given in the at-exit command only. Next is working but clear is not working.
Please provide me the solution.
Thanks
Karthikeyan.LHi,
To avoid automatic input checks you have to assing function type - E to appropriate screen field, which is not to be checked.
These function codes don't trigger PAI processing, instead they go directly to
MODULE mod AT EXIT-COMMAND.
..placed in PAI of the screen. In this way you can ommit automatic checks performed by system on mandatory fields. Please ensure you have assing E type to next and clear functions in GUI status.
Regards
Marcin -
Selection screen field problem
Hello experts..
i have a selection screen , in that i have a field s_bwart for mseg-bwart.
some times the user will input the data in the field and sometimes he wont. we have fixed movement types combination like
11-21 , 13-24 , 13-56 , 101-543 , 101-544 etc.
if the user did not input any thing in the selection screen , i am populating s_bwart in at-selection screen event with all the mvt types. after executing the report when user presses the back button to come to the selection screen, there the s_bwart field is containing all the mvt types in single values ie in the select options screen. So the user dont want that, if he comes back nothing should be there in the selection screen field s_bwart if he has not inputted anything. if he inputs only 11 mvt type then when he comes back after executing the report he should see only 11 in the select screen field ie s_bwart. Please send the replies on how to solve the problem.hi,
in ur program try to display values for users in START-OF-SELECTION event as it triggers after the selection screen displayed for users. if user doesn't give any input then display default values in this event. and also create a variable
for ex:
data: ws_flag type c,
p_value type i.
after u display default values for users in selection screen assign the flag as ' X '
ws_flag = 'X'.
before leaving ur program based on flag try to do like this.
if ws_flag = ' X '.
clear s_data. // s_data is the select options for u.
else.
s_data = p_value. // the value which user gave in selection screen as i/p.
endif.
if helpful reward some points.
with regards,
Suresh Aluri. -
Hi,
I want to group the selection screen fields. where should i group.
I want to group using the modif Id
T Y P E S
TYPES:
BEGIN OF TYVBAK,
VBELN TYPE VBAK-VBELN,
AUART TYPE VBAK-AUART,
AUDAT TYPE VBAK-AUDAT,
KUNNR TYPE VBAK-KUNNR,
NETWR TYPE VBAK-NETWR,
END OF TYVBAK.
D A T A D E C L A R A T I O N S
DATA:
STVBAK TYPE TYVBAK,
ITVBAK TYPE TABLE OF TYVBAK.
S E L E C T I O N S C R E E N
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS:
SKUNNR FOR STVBAK-KUNNR.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS:
SVBELN FOR STVBAK-VBELN,
SAUDAT FOR STVBAK-AUDAT.
SELECTION-SCREEN END OF BLOCK B2.
I N I T I A L I Z A T I O N
*INITIALIZATION.
FILLING SELECT OPTIONS WITH DEFAULTS
SKUNNR-SIGN = 'I'.
SKUNNR-OPTION = 'BT'.
SKUNNR-LOW = '1'.
SKUNNR-HIGH = '4000000'.
APPEND SKUNNR.
T O P O F P A G E
TOP-OF-PAGE.
WRITE:/1'SALES DOC',12 'DOC TYPE',20 'SALES DATE',32 'NETWORTH',60 'CUSTOMER'.
*A T S E L E C T I O N S C R E E N O U T P U T .
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-NAME = 'SVBELN-LOW'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
IF SCREEN-NAME = 'SVBELN-HIGH'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
where should i group SBVELN and SAUDATHi
Instead of SCREEN-NAME use SCREEN-GROUP1 and for your select options give MODIF ID.
As follows
SELECTION-OPTIONS: selcrt for dobj MODIF ID MOD1.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CHECK SCREEN-GROUP1 = 'MOD1.
SCREEN-REQUIRED = 1.
MODIFY SCREEN.
ENDLOOP.
This is COZ when you use select-options you get TWO fileds on the INPUT screen LOW and HIGH so you have to check for selcrit-low and selctri-high you can avoid all this my assigning a MODIF ID.
See this sample programs for this
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: pa_file TYPE rlgrap-filename MODIF ID abc,
pa_lifnr TYPE lfa1-lifnr MODIF ID abc,
pa_vkorg TYPE vbak-vkorg MODIF ID abc.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: pa_kunnr TYPE vbak-kunnr MODIF ID def.
SELECT-OPTIONS: s_lifnr FOR gs_lfa1-lifnr MODIF ID def,
s_date FOR gs_lfa1-erdat MODIF ID def,
s_augru FOR gs_vbak-augru MODIF ID def,
s_vbeln FOR gs_vbak-vbeln MODIF ID def.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pa_upd RADIOBUTTON GROUP g1 USER-COMMAND uc01 DEFAULT 'X'."#EC *
SELECTION-SCREEN COMMENT 3(60) text-004 FOR FIELD pa_upd.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: pa_rep RADIOBUTTON GROUP g1 ."#EC *
SELECTION-SCREEN COMMENT 3(60) text-005 FOR FIELD pa_rep.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b3.
IF pa_rep EQ gc_x.
LOOP AT SCREEN.
IF screen-group1 = gc_abc.
screen-input = gc_zero_num.
ELSEIF screen-group1 = gc_def.
screen-active = gc_one_num.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSEIF pa_upd EQ gc_x.
*For Reprocessing
LOOP AT SCREEN.
IF screen-group1 = gc_def.
screen-input = gc_zero_num.
ELSEIF screen-group1 = gc_abc.
screen-active = gc_one_num.
ENDIF.
MODIFY SCREEN.
CLEAR pa_upd.
ENDLOOP.
ENDIF.
REPORT zrich_001.
PARAMETERS: p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X'
user-command chk,
p_rad2 RADIOBUTTON GROUP grp1.
SELECT-OPTIONS: s_datum1 FOR sy-datum MODIF ID d1,
s_datum2 FOR sy-datum MODIF ID d2.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_rad1 = 'X'
AND screen-group1 = 'D2'.
screen-active = '0'.
ENDIF.
IF p_rad2 = 'X'
AND screen-group1 = 'D1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP -
Screen Fields Not getting Updated with DYNP_VALUES_UPDATE
Hi All,
I am using FM DYNP_VALUES_READ to read the screen field values and then modifying those values and passing the modified table to DYNP_VALUES_UPDATE. But the problem is screen fields are not populated with these values . The values I wish to populate are footer values . I am using OO ALV for this wherein I am handling an event for filter of records and accordingly I need to modify my footer. Any Suggestions??
*& Form footer
Caslculate Total items, number of hits/Miss and percent MSP
--> p1 text
<-- p2 text
FORM footer .
CLEAR : io_totitems,
io_tothit,
io_totmiss,
io_permiss.
IF NOT l_flag EQ 1.
Get total items
DESCRIBE TABLE i_outdata LINES io_totitems.
LOOP AT i_outdata INTO wa_outdata.
calculate number of hits
IF wa_outdata-hit_miss = 'HIT'.
io_tothit = io_tothit + 1.
ENDIF.
calculate number of Miss
IF wa_outdata-hit_miss = 'MISS'.
io_totmiss = io_totmiss + 1.
ENDIF.
CLEAR wa_outdata.
ENDLOOP.
calculate percent MSP
io_permiss = ( ( io_totitems - io_totmiss ) / io_totitems ) * 100 .
IF l_flag EQ 1.
wa_dynpread-fieldname = 'IO_TOTITEMS'.
APPEND wa_dynpread TO t_dynpread.
wa_dynpread-fieldname = 'IO_TOTHIT'.
APPEND wa_dynpread TO t_dynpread.
wa_dynpread-fieldname = 'IO_TOTMISS'.
APPEND wa_dynpread TO t_dynpread.
wa_dynpread-fieldname = 'IO_PERMISS'.
APPEND wa_dynpread TO t_dynpread.
CLEAR wa_dynpread.
d020s-prog = sy-repid.
d020s-dnum = sy-dynnr.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = d020s-prog
dynumb = d020s-dnum
translate_to_upper = 'X'
REQUEST = ' '
TABLES
dynpfields = t_dynpread.
MOVE io_totitems TO io_totitem.
CONDENSE io_totitem NO-GAPS.
MOVE io_tothit TO io_tothits.
CONDENSE io_tothits NO-GAPS.
MOVE io_totmiss TO io_totmis.
CONDENSE io_totmis NO-GAPS.
MOVE io_permiss TO io_permis.
CONDENSE io_permis NO-GAPS.
LOOP AT t_dynpread INTO wa_dynpread.
CASE: wa_dynpread-fieldname.
WHEN 'IO_TOTITEMS'.
wa_dynpread-fieldvalue = io_totitem .
MODIFY t_dynpread FROM wa_dynpread.
WHEN 'IO_TOTHIT'.
wa_dynpread-fieldvalue = io_tothits.
MODIFY t_dynpread FROM wa_dynpread.
WHEN 'IO_TOTMISS'.
wa_dynpread-fieldvalue = io_totmis.
MODIFY t_dynpread FROM wa_dynpread.
WHEN 'IO_PERMISS'.
wa_dynpread-fieldvalue = io_permis .
MODIFY t_dynpread FROM wa_dynpread.
ENDCASE.
CLEAR wa_dynpread.
ENDLOOP.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = d020s-prog
dynumb = d020s-dnum
TABLES
dynpfields = t_dynpread
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
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.
Get all fotter details in a internal table
this is used to download footer in Excel
wa_footer-fldname = 'Total Items '.
wa_footer-value = io_totitems.
APPEND wa_footer TO i_footer.
wa_footer-fldname = 'Number of HIT'.
wa_footer-value = io_tothit.
APPEND wa_footer TO i_footer.
wa_footer-fldname = 'Number of MISS'.
wa_footer-value = io_totmiss.
APPEND wa_footer TO i_footer.
wa_footer-fldname = 'Percentage MISS '.
wa_footer-value = io_permiss.
APPEND wa_footer TO i_footer.
CLEAR wa_footer.
ENDFORM. " footerdata: t_dynfields1 type table of dynpread with header line.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = d020s-prog
dynumb = d020s-dnum
translate_to_upper = 'X'
REQUEST = ' '
TABLES
dynpfields = t_dynfields1.
<b>read table t_dynfields1 index 1</b> I hope this is missing
I will be selecting from a list .
Because once the value is read we need to update the screen field with that value .
Here the selected value will be in the first place
Now
Your operation is to populate the fields with some variables .
In the same when I do this there is only one value then
Im expecting only one entry here
LOOP AT t_dynpread INTO wa_dynpread.
CASE: wa_dynpread-fieldname.
WHEN 'IO_TOTITEMS'.
wa_dynpread-fieldvalue = io_totitem .
MODIFY t_dynpread FROM wa_dynpread.
WHEN 'IO_TOTHIT'.
wa_dynpread-fieldvalue = io_tothits.
MODIFY t_dynpread FROM wa_dynpread.
WHEN 'IO_TOTMISS'.
wa_dynpread-fieldvalue = io_totmis.
MODIFY t_dynpread FROM wa_dynpread.
WHEN 'IO_PERMISS'.
wa_dynpread-fieldvalue = io_permis .
MODIFY t_dynpread FROM wa_dynpread.
ENDCASE.
CLEAR wa_dynpread.
ENDLOOP. */
Comment this for a while and
Change the code as
t_dynfields1-fieldname = ' '. "<--- header name
t_dynfields1-fieldvalue = ' '."<----val
append t_dynfields1.
t_dynfields1-fieldname = ' '.
t_dynfields1-fieldvalue = ' '.
append t_dynfields1.
t_dynfields1-fieldname = ' '.
t_dynfields1-fieldvalue = ' '.
append t_dynfields1.
And check .
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = d020s-prog
dynumb = d020s-dnum
TABLES
dynpfields = t_dynfields1.
regards,
vijay -
DYNP_VALUES_UPDATE does not change the value of my screen fields
Hi,
I have a screen with a header area and a control with an ALV.
In my header area i have 2 fields shown as an icon. These icons should change
with an event triggered in the ALV (in handle_user_command)
In handle_user_command I check the values of a column in my ALV - I have 3 possible cases : a green led, a yellow led or a red led.
When i'm debugging the program, everything seems to be ok. In my table i see the new values of the icons, but when I see the screen afterwards the old values have not been replaced. (I also use an refresh of my ALV)
Any help is welcome!
THx,
HelgaHi,
declare the internal table like below:
DATA: i_fieldvalues TYPE dynpread OCCURS 0 WITH HEADER LINE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR field.
PERFORM Display_contion_types.
FORM Display_contion_types.
Search help for Condition Type
PERFORM Display_contion_types.
Update screen fields like below:
Update Screen Field.
CLEAR i_fieldvalues[].
MOVE: 'V_TEXT' TO i_fieldvalues-fieldname .
WRITE i_t685-vtext TO i_fieldvalues-fieldvalue .
APPEND i_fieldvalues.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = i_fieldvalues.
endif
regards,
Raja -
DYNP_VALUES_UPDATE not updating SCREEN FIELD PERNAM
Following code not working. screen field pernam not getting updated. pls advise.
tables:zmara ,DFIES.
PARAMETER: pmatnr LIKE zmara-matnr,
pernam like zmara-ernam.
AT SELECTION-SCREEN ON PMATNR.
perform p2.
FORM P2.
*****READ
DATA: SCREEN_VALUES TYPE TABLE OF DYNPREAD ,
SCREEN_VALUE LIKE LINE OF SCREEN_VALUES.
DATA: MATNR1 LIKE ZMARA-MATNR,
ERNAM1 LIKE ZMARA-ERNAM.
SCREEN_VALUE-FIELDNAME = 'PMATNR' . " Field to be read
APPEND SCREEN_VALUE TO SCREEN_VALUES. " Fill the table
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = SCREEN_VALUES.
read TABLE SCREEN_VALUES INDEX 1 INTO SCREEN_VALUE.
MATNR1 = SCREEN_VALUE-FIELDVALUE.
*OVERLAY MATNR1 WITH '000000000000000000'.
*SHIFT MATNR1 RIGHT DELETING TRAILING SPACE.
UNPACK MATNR1 TO MATNR1.
SELECT ERNAM FROM ZMARA INTO ERNAM1 WHERE MATNR = MATNR1.
ENDSELECT.
*message ERNAM1 TYPE 'I'.
**********UPDATE
CLEAR SCREEN_VALUES[].
CLEAR SCREEN_VALUE.
SCREEN_VALUE-FIELDNAME = 'PERNAM' . " Field to be read
SCREEN_VALUE-FIELDVALUE = ERNAM1.
APPEND SCREEN_VALUE TO SCREEN_VALUES. " Fill the table
CLEAR SCREEN_VALUE.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
DYNAME = sy-CPROG
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = SCREEN_VALUES.
loop at screen_values into screen_value.
message SCREEN_VALUE-FIELDVALUE TYPE 'I'.
ENDLOOP.
ENDFORM.
Moderator Message: Put a little more effort from your end. Did you check in Debugger?
Edited by: kishan P on Mar 30, 2011 12:21 PMHi Manfred,
Replace all the DYNP_VALUES_UPDATE-related content by the following statement:
SET USER-COMMAND 'xxx'.
While DYNP_VALUES_UPDATE does update the fields, a roundtrip is not triggered so the content of the fields will not be refreshed. The SET USER-COMMAND does that.
Hope this helps you!
Cheers, Roel -
How to Read the Screen Fields after a Transaction ?
Hi all,
I am working on the Transaction 'O4K_LICENSE'. After the transaction is run, it generates an Internal License number which is displayed on the screen. I tried using 'GET PARAMETER', but as the CALL TRANSACTION is called within a loop, the SAP Global memory is not getting refreshed and iam getting the same value for every loop for the Internal License Number.
Is there any function Module other than DYNP_VALUES_READ to get the screen field values? I tried using the above function module, but in vain and it is not getting any values.
Warm Regards,
Vijay.Well .... let me explain this very clearly.
The table OIHL has a composite primary key which is the combination of "External License Number" and "Internal License Number". The latter is generated after running the O4K_LICENSE transaction.
Moreover, iam attaching every record with a record generated in the program. Now, the same User(ERNAM) can create records having the same External License Number.
For example:
If i created a record yesterday with an external License Number 123, then say an internal lic no of 3 is assigned to it.
If i Create another record today with the same external lic no of 123, and an internal no of say 20 is attached to it, then i donot have any criterion to select the one which i have created today, as it fetches both the records.
To add to the worst, there is no timestamp field also.
Message was edited by: Vijay Sai -
Hi...
We have created Custom PDF signature plug-in using Adobe X SDK.
Earlier we had the same Custom PDF signature plug-in with Adobe 7.0 SDK and it used to show "Clear Signature Field" in context menu of digital signature placed on PDF.
After upgrading the Custom signature plug-in to Adobe X SDK (complied again with SDK X, earlier it used to be 5.0 SDK) to support Acrobat 9, X and XI for digital signature, the "Clear Signature Field" option is appearing in context menu of digital signature box. Even the "Clear Signature Field" option is not shown for the user who has signed the document.
"Clear Signature" option is available for Adobe Default Security signature.
We have not changed anything in our plug-in code apart from recompiling it with Adobe X SDK.
This is a critical issue for us.
Here is the screen-shot from signed PDF having Adobe Default signature as well as our Custom plug-in signature.
Here it clearly shows that "Clear Signature" option is not present in signature placed by Custom plug-in.
Please let us know if anyone else has faced this type of issue earlier and has a resolution.
Thanks In Advance...
WaseemI am still not getting the Clear signature option for the user who has signed the PDF using Custom PDF Signature plug-in but the same is available for Acrobat Default security signature.
Custom plug-in is compliled with Adobe X SDK and we have not made any code change to hide the Clear Signature option.
I found a related posts where Clear Signature option is not shown:
http://forums.adobe.com/message/5092195 -
Validating a selection-screen field
Hi all,
I am Anil.can any body explains me how to validate a selection-screen field for the following scenario?
I have customer nos ranging from 100-1000.among them i dont have any sales orders for the customers who are in between 150-250.I have sales order(VBELN) as select-options and Plant(WERKS) as Parameter on the selection-screen.I want to validate these fields without hardcaode.How can i do that?Please send me the complete code.
I am not getting how to validate a field which is declared as parameter?
regards and thanks in advance.
Anil.Make sure that u are validating against the header table.
say eg if u wnat t validate matnr in marc, then do as below.
SELECT-OPTIONS: s_matnr FOR marc-matnr. "Material No
AT SELECTION-SCREEN.
*Validate material no details
PERFORM validate_matno.
FORM validate_matno.
DATA: v_matnr LIEK mara-matnr.
SELECT SINGLE matnr INTO v_matnr
FROM <b>mara</b>
WHERE matnr IN s_matnr.
IF sy-subrc NE 0.
MESSAGE i128.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM.
Dont select from marc.
Hope this is clear. -
Selection-screen fields validation for dialog
Hello ABAP Gurus
Requirements: this is a report wherein , depending upon the correct select-options , user will pick some field values from table and some will be entered by the user in the next se51 custom screen for creation of a record in a ztable .
the problem is :without validating select-options values , it calls the se51 screen 100.
How to keep the cursor at the selection-screen field until & unless user enters the correct i/p s .if i/p are correct then only it should call screen 100 otherwise remain in the selection screen only .
*& Report ZSD_REP_QUOT_BANK_CREATE *
REPORT ZSD_REP_QUOT_BANK_CREATE NO STANDARD PAGE HEADING LINE-SIZE 255.
TABLES: VBAK,VBAP,VBRK,ZSD_TABL_QOTBANK,MARA,KONV.
DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK_CODE LIKE SY-UCOMM,
WA_ITAB LIKE ZSD_TABL_QOTBANK,
ANSWER TYPE C,
COPIED ,
STS TYPE N,
EMGRP LIKE MARA-EXTWG,
QTY LIKE ZSD_TABL_QOTBANK-QTY,
UPRICE LIKE ZSD_TABL_QOTBANK-UPRICE,
TOT LIKE ZSD_TABL_QOTBANK-TOT,
INO LIKE VBAP-POSNR.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
SELECT-OPTIONS: S_QTNO FOR ZSD_TABL_QOTBANK-QTNO
NO INTERVALS NO-EXTENSION OBLIGATORY,
S_ITNO FOR ZSD_TABL_QOTBANK-ITNO
NO INTERVALS NO-EXTENSION OBLIGATORY.
S_MATNO FOR ZSD_TABL_QOTBANK-MATNO
NO INTERVALS NO-EXTENSION. "
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN.
SELECT SINGLE VBTYP
INTO VBAK-VBTYP
FROM VBAK
WHERE VBELN IN S_QTNO.
IF SY-SUBRC EQ 0 AND VBAK-VBTYP NE 'B'.
MESSAGE I005(ZQOTBANK).
SET CURSOR FIELD S_QTNO-LOW.
SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
ENDIF.
CLEAR WA_ITAB.
SELECT SINGLE QTNO ITNO
INTO WA_ITAB
FROM ZSD_TABL_QOTBANK
WHERE QTNO IN S_QTNO
AND ITNO IN S_ITNO.
IF SY-SUBRC EQ 0.
MESSAGE I001(ZQOTBANK).
SET CURSOR FIELD S_QTNO-LOW.
SET CURSOR FIELD S_ITNO-LOW.
SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
ENDIF.
*START-OF-SELECTION.
END-OF-SELECTION.
CALL SCREEN 0100.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS '0100'.
SET TITLEBAR '0100'.
ZSD_TABL_QOTBANK-QTNO = S_QTNO-LOW.
SELECT SINGLE BUKRS_VF VKORG VTWEG SPART KUNNR ERDAT BNDDT
KNUMV
INTO (ZSD_TABL_QOTBANK-CCODE,
ZSD_TABL_QOTBANK-SORG,
ZSD_TABL_QOTBANK-DISTCHAN,
ZSD_TABL_QOTBANK-DIV,
ZSD_TABL_QOTBANK-CUSTNO,
ZSD_TABL_QOTBANK-QTDAT,
ZSD_TABL_QOTBANK-QTVALDAT,
VBAK-KNUMV)
FROM VBAK
WHERE VBELN IN S_QTNO
AND VBTYP = 'B'.
IF SY-SUBRC EQ 0.
SELECT SINGLE KWMENG POSNR MATNR
INTO (QTY , INO , ZSD_TABL_QOTBANK-MATNO)
FROM VBAP
WHERE VBELN IN S_QTNO.
SELECT SINGLE EXTWG
INTO EMGRP
FROM MARA
WHERE MATNR EQ ZSD_TABL_QOTBANK-MATNO.
ZSD_TABL_QOTBANK-ITNO = INO.
ZSD_TABL_QOTBANK-EMATGRP = EMGRP.
ZSD_TABL_QOTBANK-QTY = QTY.
SELECT SINGLE KBETR
INTO UPRICE
FROM KONV
WHERE KNUMV = VBAK-KNUMV
AND KPOSN = INO
AND KSCHL = 'PR00'.
ENDIF.
ZSD_TABL_QOTBANK-UPRICE = UPRICE.
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-CGL_QTY.
UPRICE = ZSD_TABL_QOTBANK-CGL_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-CGL_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-BHEL_QTY.
UPRICE = ZSD_TABL_QOTBANK-BHEL_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-BHEL_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-BHEL_QTY.
UPRICE = ZSD_TABL_QOTBANK-BHEL_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-BHEL_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-ALSTOM_QTY.
UPRICE = ZSD_TABL_QOTBANK-ALSTOM_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-ALSTOM_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-SIEMENS_QTY.
UPRICE = ZSD_TABL_QOTBANK-SIEMENS_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-SIEMENS_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-TELK_QTY.
UPRICE = ZSD_TABL_QOTBANK-TELK_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-TELK_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
QTY = ZSD_TABL_QOTBANK-OTH_QTY.
UPRICE = ZSD_TABL_QOTBANK-OTH_UPRICE .
TOT = QTY * UPRICE .
ZSD_TABL_QOTBANK-OTH_TOT = TOT .
CLEAR: QTY, UPRICE, TOT.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'SAVE'.
INSERT ZSD_TABL_QOTBANK.
IF SY-SUBRC EQ 0.
MESSAGE I000(ZQOTBANK).
COMMIT WORK.
CALL SELECTION-SCREEN 1000.
ELSE.
MESSAGE E001(ZQOTBANK).
CALL SELECTION-SCREEN 1000.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module EXIT_COMMAND INPUT
text
MODULE EXIT_COMAND INPUT.
SAVE_OK_CODE = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK_CODE.
WHEN 'CANCEL'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Quotation Bank Entry'
TEXT_QUESTION = 'Do you want to Cancel ?'
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
IMPORTING
ANSWER = ANSWER.
IF ANSWER = '1'.
LEAVE PROGRAM.
ELSE.
CALL SELECTION-SCREEN 1000.
ENDIF.
WHEN 'EXIT'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Quotation Bank Entry'
TEXT_QUESTION = 'Do you want to Exit ?'
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
IMPORTING
ANSWER = ANSWER.
IF ANSWER = '1'.
LEAVE PROGRAM.
ELSE.
CALL SELECTION-SCREEN 1000.
ENDIF.
ENDCASE.
ENDMODULE. " EXIT_COMMAND INPUT
Thnx in AdvancePut the statement
CALL SCREEN 100
in the event <b>AT SELECTION-SCREEN</b> and NOT in <b>END-OF-SELECTION</b>.
Regards,
Subramanian V. -
Screen field f4 help with a table of 5*5 as a popup
hi all,
I have screen-field (location id) when the user press f4 a table with 5 rows and 5 columns should popup. When I select any of the cell in the table that value to be taken as input for the screen-field.
how to solve this requirement?Hi uday
In the following code project id, Object id and object name will display in the F4 screen but only object id will be placed in the screen field.
Constants:
c_objectid TYPE dfies-fieldname
VALUE 'OID', " Object ID for F4 help
c_fieldoid TYPE help_info-dynprofld
VALUE 'P_OID',
" To hold fieldname of object ID
c_char_s(1) TYPE c
VALUE 'S'. " Approved status - Saved
* Field-string for it_values............................................
DATA:
BEGIN OF fs_value,
pid TYPE zcl_prjid, " Project ID
oid TYPE zcl_objid, " Object ID
oname TYPE zcl_objname, " Object description
END OF fs_value.
Data:
it_values LIKE STANDARD TABLE OF fs_value,
" Table for object ID F4 help
PARAMETERS:
p_oid TYPE zcl_objects-oid.
at selection-screen on value-request for P_OID.
PERFORM f4help_objectid.
* FORM F4HELP_OBJECTID *
* This subroutine is used for F4help in object ID i.e. to get *
* corresponding object ID based on the project ID entered. *
* There are no interface parameters to be passed to this subroutine. *
FORM f4help_objectid.
GET CURSOR LINE w_lineno.
fs_sc_val-fieldname = 'FS_TIMESHEET-PID'.
fs_sc_val-stepl = w_lineno.
APPEND fs_sc_val TO it_sc_val.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = it_sc_val
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 EQ 0.
READ TABLE it_sc_val INTO fs_field
WITH KEY fieldname = c_fieldname.
ENDIF. " IF sy-subrc EQ 0
SELECT projectid " Project ID
objectid " Object ID
objectname " Object Name
FROM zcl_objects
INTO TABLE it_values
WHERE projectid EQ fs_field-fieldvalue.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = c_objectid "* Here c_objectid = 'OID' and here OID is the field name in field string*
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = c_fieldoid
value_org = c_char_s
TABLES
value_tab = it_values.
CLEAR fs_timesheet-pid.
REFRESH it_values.
REFRESH it_sc_val.
ENDFORM. " F4HELP_OBJECTID
Regards,
Mahi.
Edited by: Maheswari Chegu on Nov 5, 2008 7:57 AM
Maybe you are looking for
-
Hi.. I have apple TV 2 (the new one) and I have problem after purchasing a TV show or movie from apple.. where it gives me a messege 'An error occured loading this content please try again later'. I tried again for almost 2 weeks but still same probl
-
How can I get my iPhone 3Gs to power up?
I shut my 3Gs phone off overnight and then turned it on,set it in the Belkin holder in my car, and fiddled with the radio to set up a station for play. The phone went dead. I tried to get it going again. I held the start button down and no luck. I ke
-
Logical system not seen in ID (7.0)
Dear XI experts, i defined in SLD a logical system as application system (SAP BACKEND)to send and receive IDOCS. I am trying to assign a Business system in the ID which I defined in the SLD and cant seem to find this in the ID. What must have I misse
-
Deactivated songs after sync. still on iphone
So, I sync. my iPhone yesterday and suddendly there were all my deactivated Song on it... (This wasn't really the plan.) I deleted some of them, but I don't want to delet all my deactivated songs, only for my phone. I mean, they should stay in their
-
Safari 3.1.2 timing out my downloads
Im trying to download Adobe photoshop elements 6 free trial and Safari is timing out withing 30-60 seconds after starting the download. Hints, fixes?