2010 Sep 01 3:27 PM
Hi, I have created foreign keys to the fields "fesc" and "aplic" of the table "zfk_table". The foreign key for the field "aplic" consists of the fields "mandt" and "aplic." On the other hand the foreign key for the field "fesc" is formed by the fields "mandt", "aplic" and "fesc".
The check table for the field "aplic" is "ZCHTABLE_APLIC" whose primary key is "mandt" and "aplic". For the field "fesc" the check table is "ZCHTABLE_FESC" whose primary key is "mandt", "aplic" and "fesc".
Now, when I use the fields "fesc" and "aplic" of the table "zfk_table" as input fields in a screen (dynpro), input checks work correctly, but when these fields are used in a selection screen in a executable program (Type 1), input check for the "fesc" send a error message, but the data exist in the check table "ZCHTABLE_FESC".
This is the source code in the selection screen.:
SELECTION-SCREEN BEGIN OF BLOCK bl01 WITH FRAME TITLE text-t01.
PARAMETERS: pa_apli LIKE zfk_table-aplic OBLIGATORY VALUE CHECK.
PARAMETERS: pa_fesc LIKE zfk_table-fesc OBLIGATORY VALUE CHECK.
SELECTION-SCREEN END OF BLOCK bl01.What could be happening?
2010 Sep 01 3:56 PM
Hi Marcel,
You should explicitly validate under the AT SELECTION_SCREEN ON event & check from its check table.
Just refer the below code snippet.
'
IF parm_cur IS NOT INITIAL.
SELECT COUNT(*) FROM tcurc UP TO 1 ROWS WHERE waers = parm_cur.
IF sy-subrc NE 0.
MESSAGE e012(e2) WITH parm_cur.
ENDIF.
ENDIF.
Here TCURC is the check table.
PARM_CUR is the Parameter on Selection screen.
Hope this helps.
Regards
Abhii
Hi, I have created foreign keys to the fields "fesc" and "aplic" of the table "zfk_table". The foreign key for the field "aplic" consists of the fields "mandt" and "aplic." On the other hand the foreign key for the field "fesc" is formed by the fields "mandt", "aplic" and "fesc".
The check table for the field "aplic" is "ZCHTABLE_APLIC" whose primary key is "mandt" and "aplic". For the field "fesc" the check table is "ZCHTABLE_FESC" whose primary key is "mandt", "aplic" and "fesc".
Now, when I use the fields "fesc" and "aplic" of the table "zfk_table" as input fields in a screen (dynpro), input checks work correctly, but when these fields are used in a selection screen in a executable program (Type 1), input check for the "fesc" send a error message, but the data exist in the check table "ZCHTABLE_FESC".
This is the source code in the selection screen.:
SELECTION-SCREEN BEGIN OF BLOCK bl01 WITH FRAME TITLE text-t01.
PARAMETERS: pa_apli LIKE zfk_table-aplic OBLIGATORY VALUE CHECK.
PARAMETERS: pa_fesc LIKE zfk_table-fesc OBLIGATORY VALUE CHECK.
SELECTION-SCREEN END OF BLOCK bl01.What could be happening?
2010 Sep 01 3:56 PM
Hi Marcel,
You should explicitly validate under the AT SELECTION_SCREEN ON event & check from its check table.
Just refer the below code snippet.
'
IF parm_cur IS NOT INITIAL.
SELECT COUNT(*) FROM tcurc UP TO 1 ROWS WHERE waers = parm_cur.
IF sy-subrc NE 0.
MESSAGE e012(e2) WITH parm_cur.
ENDIF.
ENDIF.
Here TCURC is the check table.
PARM_CUR is the Parameter on Selection screen.
Hope this helps.
Regards
Abhii
2010 Sep 01 4:08 PM
Hi Abhii, thanks for your answer.
I know that i can use AT SELECTION-SCREEN ON pa_xxx, but i would like know why don't work correctly the input check with foreign key for the field "fesc" in this case.
2010 Sep 01 10:23 PM
In dynpro, it doesnot work by default.
You have to mark the check box "screen check required" both while creating the foreign key and in the screen field attributes.
I dont think so you can do it in selection screen, because its dynamically generated.
2010 Sep 02 10:34 AM
Hi Marcel,
I have noticed a scenario which could be useful.
For table /BEV1/BO_LEDGER field HKONT, the check table is SKA1. In the foreign key relation ship, I see that for field KTOPL Instead of defining the foreign key table and field, generic is being defined.
I hope if you define your foreign key for the table field FESC in the similar manner, the value check should work fine.
Hope it helps.
Sujay
2010 Sep 02 4:35 PM
Hi Sujay.
I need to check all foreing key fileds in this case, because both fields "fesc" and "aplic" are dependent each other.
I found a solution (besides AT SELETION-SCREEN ON) but i don't know how convenient it. I modified the flow logic of the report screen "1000". I modified the FIELD statement for this fields.
2010 Sep 02 5:59 PM
No, definitely not suggested. You shouldn't be modifying the selection-screen logic.
You should rather look at the foreign key tables & how the entries are maintained. I tried this code & works for me:
PARAMETERS: pa_buk TYPE bkpf-bukrs OBLIGATORY VALUE CHECK.BR,
Suhas
2010 Sep 02 9:30 PM
Hi Suhas, thanks for your answer.
Me too tried with same code:
SELECTION-SCREEN BEGIN OF BLOCK bl01 WITH FRAME TITLE text-t01.
PARAMETERS: pa_apli LIKE zfk_table-aplic OBLIGATORY VALUE CHECK.
PARAMETERS: pa_fesc LIKE zfk_table-fesc OBLIGATORY VALUE CHECK.
SELECTION-SCREEN END OF BLOCK bl01.For the "pa_apli" work correctly, but the "pa_fesc" not work, i.e, input check for the "pa_fesc" send a error message, but the data exist in the check table "ZCHTABLE_FESC".
Look at above the primary key fields of "ZCHTABLE_FESC" and "ZCHTABLE_APLIC" tables.
2015 Aug 14 6:01 PM
Hi Marcel,
Did you find any solution? I have the same problem in a Dialog program :S.
Regards
Obed