‎2010 Oct 12 6:46 AM
HI All ,
I have a pop-up in my report that user can create data type in didc,
There is a simple way to support validation for data types ,
I have pop-up where the user need to provide name of attribute
he need to create and the data type for it (char ,string ,int etc )
and he also need to provide the leng of the attribute he want to create
(e.g. char10 ) and also decimal places .
the issue here that i need to do some validation in the pop-up
for e.g. if user choose
case 1
name - attribute1
datatype - string
leng - in this case he dont need to provide leng (string )
dec - dont need to provide (string )case 2
name - attribute1
datatype - char
leng - 10
dec - dont need to provide (char )Any idea how to do this validation in a simple way (maybe to use standard functionlity)
Regards
Alex
‎2010 Oct 12 7:10 AM
Hi Alex,
What kind of pop-up are you using? Is it a pop-up screen or any other function for pop-up?
Regards,
Immanuel.
‎2010 Oct 12 7:10 AM
Hi Alex,
What kind of pop-up are you using? Is it a pop-up screen or any other function for pop-up?
Regards,
Immanuel.
‎2010 Oct 12 7:13 AM
HI Immanuel ,
I am using screen pop-up that i create with a domain (listbox ) that we create for 15 diff data types
Regards
Alex
‎2010 Oct 12 7:41 AM
Hi Alex,
There are a few FMs starting with DD_DOMA and DD_DTEL. Please check if any of these can help you to validate the data elements and domain creation.
Regards,
Immanuel.
‎2010 Oct 12 7:55 AM
HI ,
DO you have some example how to use this FM for instance
for string or int or char ?
Regards
Alex
‎2010 Oct 12 8:06 AM
Hi Alex,
I do not have any example.
If you are not comfortable with using these FMs validate manually.
Set a user-command for the list box. This will trigger the PAI and the PBO when the user chooses the data type in list box. In the PBO check for the value selected in the list box and gray off the unwanted fields. Say if the value of list box is STRING then set SCREEN-INPUT = 0 for the field LENGTH and DEC.
Please check the help on screen programming for more details on how to gray off or hide fields in screens.
Regards,
Immanuel.
‎2010 Oct 12 9:54 AM
HI Immanuel ,
Do you mean to something like this ?
LOOP AT SCREEN.
IF screen-name = 'S_C_STR_POPUP-BASE_TYPE' AND BASE_TYPE = 'String'.
IF screen-name = 'GV_LENG' OR screen-name = 'GV_DEC'.
screen-input = 0.
ENDIF.
ENDIF.
ENDLOOP.how i modify the screen since the second if will not work .
Regards
Alex
‎2010 Oct 12 10:16 AM
Hi Alex,
Yes. You have to have some code like that.
CASE List box content .
WHEN 'STRING'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'LENGTH' OR
SCREEN-NAME = 'DEC'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
WHEN 'CHAR'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'LENGTH' OR
SCREEN-NAME = 'DEC'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
WHEN 'INT'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'DEC'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDCASE.
.
Regards,
Immanuel.
Edited by: Immanuel T A on Oct 12, 2010 11:17 AM
‎2010 Oct 12 12:11 PM
HI Immanuel ,
There is event that wneh the user choose in the popup the field with the F4 that
i can trigger since than i can do all the logic .
i try to put a break point in handle datatype module and i wont stop .
FIELD datatype
MODULE handle_datatype ON REQUEST.
and also i try
FIELD datatype
MODULE handle_datatype ON INPUT.
Best regards
Alex
Edited by: Alex Dean on Oct 12, 2010 1:22 PM
‎2010 Oct 12 2:13 PM
Hi Alex,
Fill the FctCode field in the field attritbute of the list box. Only after the function code is assigned to the list box the PAI and PBO will be triggered for the screen.
Regards,
Immanuel.
Edited by: Immanuel T A on Oct 12, 2010 3:15 PM
‎2010 Oct 12 7:24 AM
The attribute of the field is chang.
CHAR:screen-invisible = '0'
STRING:screen-invisible = '1'
or
CHAR:screen-invisible = '1'
STRING:screen-invisible = '0'
‎2010 Oct 12 7:54 AM
HI Tayori ,
Thanks , Assume that i have in the pop-up 4 fields and when the
user choose a string can i omit the fields of leng and dec after it ?
If so where should i put this code in the FM of the popup or pai pbo ?
Regards
Alex
‎2010 Oct 12 8:31 AM
Can the pushbutton be made?
TOP include
data:
flag type c value '1'.
BPO.
if FRAG = '1'.
CHAR:screen-Invisible = '1'.
STRING:screen-Invisible = '0'.
else.
screen-Invisible = '0'.
screen-Invisible = '1'.
endif.
PAI.
case OKCODE.
when button1
FRAG = '1'.
when button2
FRAG = '2'.
endcase.
‎2010 Oct 12 12:26 PM
Hello,
Just place a debug point in routine PERFORM F4PROZ of function module DD_SHLP_CALL_FROM_DYNP. Then execute your standard f4 functionality of predefined type in SE11. It just holds few steps which can easily taken into your custom code.
You can get this same search help in your program with screen fields disabled and letting the user chose it in the force mode of F4_INIT_TABLE_VALUE_REQUEST.
‎2010 Oct 12 12:47 PM
hi Keshav.T
There is event that wneh the user choose in the popup the field with the F4 that
i can trigger since than i can do all the logic .
i try to put a break point in handle datatype module and i wont stop .
after the PAI i put this code
FIELD datatype
MODULE handle_datatype ON REQUEST.
and also i try
FIELD datatype
MODULE handle_datatype ON INPUT.
Best regards
Alex
‎2010 Oct 12 12:54 PM
Is this popup done through modal window popup or any function modules.
if its a function module i doubt whether it triggers the validation written.
‎2010 Oct 12 12:57 PM
HI Keshav.T ,
The event that you mentioned in your previos post is trigger when the user choose the F4
but i dont understand how can i use it .
what i want to do is when the user press F4 and choose datatype to trigeer event and than
decide if to omit some field from the popup
.
I created for the popup a function module with call screen.
Thanks
Alex
‎2010 Oct 12 1:05 PM
The event that you mentioned in your previos post is trigger when the user choose the F4
but i dont understand how can i use it .
In Se11 when f4 is pressed for predefine data types that routine gets triggered.
I created for the popup a function module with call screen.
Then your validation for module will not trigger. It will get triggered for screen fields. Not for the input text boxes provided by fm popup.
‎2010 Oct 12 1:22 PM
HI Keshav.
What i did is created a popup with FM in the popup i have 4 field
the field with the data type which i want to trigger event to it is domain and not ref to FM
The ppoup have 4 field
attr name
datatype
length
decimal
so from what you are say there is not option to trigger event when the user press F4
and choose a entry from it ,
since what i want to do is that if user for instance chose string i want that the next to fields (length and dec ) will be
remove from the popup since he dont need them .
and for he choose char the the decimal field will remove from the popup
Any idea how to solve this issue ?
Regards
Alex
Edited by: Alex Dean on Oct 12, 2010 3:02 PM