‎2014 Jul 01 10:57 AM
Hi All,
i have written a module pool program, in which i have to fetch a field from database when user enters an entry corresponds to it, i have a field rm_name
on my screen, when users put a value into it , i wants to fetch its related broker name from another table on ENTER .
For this i have written my code as shown below, but the debugger is not getting inside it and is giving SY-SUBRC = 8.
Please suggest me where i am wrong
MODULE user_command_1000 INPUT.
WHEN 'ENTER'.
SELECT part_code PARTNER_NAME RM_NAME emp_code FROM ZINCENTIVES INTO TABLE it_zincentives WHERE RM_NAME = P_NAME1.
i get my data in p_name1 but i am not getting the values into my internal table it_zincentives, i have tried by taking some variables in place of internal table
but still not getting my desired result.
‎2014 Jul 01 11:27 AM
please check it in database table for respective p_name1 whether values are present or not.
‎2014 Jul 01 11:45 AM
Hi
do you mean that debugger is not entering your modul user_command_1000?
did you set it in PAI (point after input) event?
you did not show complete code - are there any syntax errors left? did you activate befor starting?
maybe you have to refresh your navigation index. (sometimes debugger is going threw new code, while old code is displayed in abap workbench - refreshing index solves this)
regards
Stefan Seeburger
‎2014 Jul 01 12:06 PM
Hi Shwetha,
After reading from data base you need to assign the read value to screen field.
Please give the correct info when you are getting the sy-subrc 8.
‎2014 Jul 02 6:49 AM
Hi all,
i have created a chain.....endchain statement inside PAI of my program, now i have fetched the concerned broker name in an internal table.
MODULE VAL_PO INPUT.
IF ZSDPROJECT1-RM_NAME IS NOT INITIAL.
SELECT PART_CODE PARTNER_NAME RM_NAME EMP_CODE FROM ZINCENTIVES INTO TABLE it_zincentives
WHERE RM_NAME = ZSDPROJECT1-RM_NAME.
ENDIF.
ENDMODULE.
******here partner_name is the name of broker which i wants to show on screen when user enters rm_name, all the concerned partner_name should get ************displayed as listbox and user can select any of them. ***********************
and in the PAI i have also created a PROCESS ON VALUE-REQUEST. in which i have written as shown below
PROCESS ON VALUE-REQUEST.
FIELD ZSDPROJECT1-BROKER MODULE FETCH_VALUES.
inside this module, in my main program i have written these code
MODULE FETCH_VALUES INPUT.
IF IT_ZINCENTIVES[] IS NOT INITIAL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
RETFIELD = 'BROKER'
* PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'ZSDPROJECT1-BROKER'
* STEPL = 0
WINDOW_TITLE = 'Select the values'
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* CALLBACK_METHOD =
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
VALUE_TAB = IT_ZINCENTIVES
* FIELD_TAB =
* RETURN_TAB =
* DYNPFLD_MAPPING =
* EXCEPTIONS
* PARAMETER_ERROR = 1
* NO_VALUES_FOUND = 2
* OTHERS = 3
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
ENDIF.
my requirement is to show the values in zsdproject1-broker field automatically as a listbox, when user enter rm_name, but i am not getting it as required, please suggest me the required changes.
‎2014 Jul 02 7:12 AM
the respective select query you have to write into POV module because if POV triggers it wont go to PAI so write ur select statement in POV
‎2014 Jul 02 7:45 AM
Hi Yogesh,
i am not getting your points, if i have already calculated values in my program , i have to just show it in the screen.
‎2014 Jul 02 8:28 AM
hi shweta,
there are certain condition you can do.
1) make the data available to program globally
2) make data available on request
if you write your seelct in PAI and like you are doing and maintained POV event
for field and at screen level if u r requesting it, then control will not go to PAI in that case data wont be ready to POV and it'll not show any value
so wht you can do it is bring the data in 1st module of PBO or get data in POV.
‎2014 Jul 02 8:31 AM
Hi Shweta ,
you have to write your select query inside the POV part as mentioned by yogesh..
for condition base serch help follow the procedure:-
in POV
1) Select query
2) CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
( get value in return tab parameter)
3) CALL FUNCTION 'DYNP_VALUES_UPDATE
hope it solve your problem.
with regards,
vikas
‎2014 Jul 02 9:31 AM
Hi,
What i understood is, you have a field RM_NAME where user enter some data, then based on that you need to fetch data from ZINCENTIVES tabel. which is used as F4 for field zsdproject1-broker.
If I'm wrong plz correct me, else then please check below..
Here the flow logic of your screen look like this...
PROCESS AFTER INPUT.
CHAIN.
FIELD RM_NAME.
MODULE VAL_PO.
ENDCHAIN.
PROCESS ON VALUE-REQUEST.
FIELD ZSDPROJECT1-BROKER MODULE FETCH_VALUES.
Now, change your logic as mentioned below this will work...
1) Write your select query in module ZSDPROJECT1-BROKER instead of MODULE VAL_PO.
2) Make sure RM_NAME contains value when you fetching data.
Write the select query in
PROCESS ON VALUE-REQUEST.
FIELD ZSDPROJECT1-BROKER MODULE FETCH_VALUES.
Make sure that ZSDPROJECT1-RM_NAME is contain value.
Example:
MODULE ZSDPROJECT1-BROKER INPUT.
IF RM_NAME IS NOT INITIAL.
SELECT PART_CODE PARTNER_NAME RM_NAME EMP_CODE FROM ZINCENTIVES INTO TABLE it_zincentives
WHERE RM_NAME = RM_NAME .
ENDIF.
IF IT_ZINCENTIVES[] IS NOT INITIAL.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
RETFIELD = 'BROKER'
* PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'ZSDPROJECT1-BROKER'
* STEPL = 0
WINDOW_TITLE = 'Select the values'
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* CALLBACK_METHOD =
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
VALUE_TAB = IT_ZINCENTIVES
* FIELD_TAB =
* RETURN_TAB =
* DYNPFLD_MAPPING =
* EXCEPTIONS
* PARAMETER_ERROR = 1
* NO_VALUES_FOUND = 2
* OTHERS = 3
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
ENDIF.
ENDMODULE.
If you still face any problem, then:
1) Your table ZINCENTIVES should contain data for RM_NAME value.
2) If your unable to debugg, try to keep external break point and debugg.
Hope this will help you...
regards,
Rajesh Sadula.