‎2010 Sep 17 5:39 AM
HI All ,
I have developed a module pool program in that i have used drop down box ,
So all the logic i had written in PBO events. I am getting the drop-down list ,
but proble is that when I am choosing the value from the drop down box list the value get selected , but when i press Enter the value Disappears simultaneously all the values in the drop down box is repeated.
i set break-point on this logic. ten i found that after seeing the output when i press enter the cursor goes to break-point once again and whole process of data fetching begins and ij o/p value get repeated in drop down box.
plz help ,
below is the CODE.
SELECT * FROM CABN INTO CORRESPONDING FIELDS OF TABLE IT_CABN WHERE ATNAM = MR_MN.
SELECT * FROM CAWN INTO CORRESPONDING FIELDS OF TABLE IT_CAWN FOR ALL ENTRIES IN IT_CABN
WHERE ATINN = IT_CABN-ATINN.
DATA : valuess TYPE VRM_VALUES,
valuee LIKE LINE OF values.
DATA : w_index TYPE N.
CLEAR valuee.
w_index = 1 .
LOOP AT IT_CAWN.
concatenate w_index IT_CAWN-ATINN into w_index.
valuee-key = w_index.
valuee-TEXT = IT_CAWN-ATWRT.
APPEND valuee TO VALUESS.
w_index = w_index + 1 .
CLEAR valuee.
CLEAR : IT_CAWN ,IT_CABN.
ENDLOOP.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'ATWRT'
VALUES = VALUESS.
* EXCEPTIONS
* ID_ILLEGAL_NAME = 1
* OTHERS = 2.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. Regards,
Anup........
Moderator Message: Please do not type in CAPS. And always enclose your in ... your code... tags.
Edited by: kishan P on Sep 17, 2010 10:11 AM
‎2010 Sep 17 5:53 AM
Hi,
Try this.
IF sy-ucomm ne 'ENTR'.
your code...
ENDIF.
Regards,
Nithya
‎2010 Sep 17 10:22 AM
‎2010 Sep 17 10:33 AM
Don't program the buildup code for the dropdown in your PBO. Program at in the PAI part for that field:
something in like:
FIELD blabla MODULE dropdown AT VALUE-REQUESTAfter each user action (like ENTER), the screen flow returns to your PBO and starts processing your PBO logic again. That's why your dropdown is duplicated.
But if you insist on keeping it in the PBO: make sure your dropdown list doesn't get appended again with the values from CAWNT.
PS. i'm glad you found the unique key.
‎2010 Sep 17 7:25 PM
if lv_mn ne MR_MN. "Only if mr_mn is different <----add this
lv_mn = MR_MN.
SELECT * FROM CABN INTO CORRESPONDING FIELDS OF TABLE IT_CABN WHERE ATNAM = MR_MN.
SELECT * FROM CAWN INTO CORRESPONDING FIELDS OF TABLE IT_CAWN FOR ALL ENTRIES IN IT_CABN
WHERE ATINN = IT_CABN-ATINN.
DATA : valuess TYPE VRM_VALUES,
valuee LIKE LINE OF values.
DATA : w_index TYPE N.
CLEAR valuee.
w_index = 1 .
LOOP AT IT_CAWN.
concatenate w_index IT_CAWN-ATINN into w_index.
valuee-key = w_index.
valuee-TEXT = IT_CAWN-ATWRT.
APPEND valuee TO VALUESS.
w_index = w_index + 1 .
CLEAR valuee.
CLEAR : IT_CAWN ,IT_CABN.
ENDLOOP.
endif.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'ATWRT'
VALUES = VALUESS.
* EXCEPTIONS
* ID_ILLEGAL_NAME = 1
* OTHERS = 2.
IF SY-SUBRC 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
‎2010 Sep 17 9:31 PM
Hi,
I was facing the same problems, as I am pretty much into screen development since last many days..
Better if you can write the fill dropdown procedure into previous screen's PAI. so that it will run once only and also there you can check the values[] initial or not brfore calling FM VRM_SET_VALUES, so that it would not give dump, if in some cases your values will not get filled in the values table.
And when you create variable in the top include with the same name as your dropdown name in screen, It will automatically hold value. And it dont get blank when you press Enter. it should be " d_variable like line of values ".
Let me know if it helps or you need any other help regarding module pool.
Regards,
bh_hir
‎2010 Sep 20 5:45 AM
Hi ,
Still I am facing the problem if i press enter key on on the keyboard then the value in the box get cleared . but i want stable value for that.
so -please help.
‎2010 Sep 20 9:53 AM
Hi,
Write the coding as :
DATA : valuess TYPE VRM_VALUES,
valuee LIKE LINE OF values,
V_ATWRT type vrm_id ,
ATWRT(10).
DATA : w_index TYPE N.
CLEAR valuee.
w_index = 1 .
V_ATWRT = 'ATWRT'.
LOOP AT IT_CAWN.
concatenate w_index IT_CAWN-ATINN into w_index.
valuee-key = w_index.
valuee-TEXT = IT_CAWN-ATWRT.
APPEND valuee TO VALUESS.
w_index = w_index + 1 .
CLEAR valuee.
CLEAR : IT_CAWN ,IT_CABN.
ENDLOOP.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = V_ATWRT
VALUES = VALUESS.
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2.
Regards,
Srini.
‎2010 Sep 21 10:50 PM
Hi,
I assume that your dropdown's screen name is ATWRT - i/o field of type listbox or listbox with key.
now declare in top include as,
DATA: ATWRT like line of values.now in populating dropdown,
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'ATWRT'
values = values.It should not get cleared when you press enter.
Let me know if it works!
Thanks & Regards,
bh_hir
‎2010 Sep 22 4:25 AM
Hi Rockabap,
Its very simple. Set a flag once u fetched data and next time check that flag before fecthcing data.
Ex:
DATA: flag type c. " Declare in TOP include as global data.
IF flag NE 'X'. " check flag
SELECT * FROM CABN INTO CORRESPONDING FIELDS OF TABLE IT_CABN WHERE ATNAM = MR_MN.
SELECT * FROM CAWN INTO CORRESPONDING FIELDS OF TABLE IT_CAWN FOR ALL ENTRIES IN IT_CABN
WHERE ATINN = IT_CABN-ATINN.
DATA : valuess TYPE VRM_VALUES,
valuee LIKE LINE OF values.
DATA : w_index TYPE N.
CLEAR valuee.
w_index = 1 .
LOOP AT IT_CAWN.
concatenate w_index IT_CAWN-ATINN into w_index.
valuee-key = w_index.
valuee-TEXT = IT_CAWN-ATWRT.
APPEND valuee TO VALUESS.
w_index = w_index + 1 .
CLEAR valuee.
CLEAR : IT_CAWN ,IT_CABN.
ENDLOOP.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'ATWRT'
VALUES = VALUESS.
* EXCEPTIONS
* ID_ILLEGAL_NAME = 1
* OTHERS = 2.
IF SY-SUBRC 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
flag = 'X'. " Once u fetched all data, set flag
ENDIF.
Thanks..
‎2010 Nov 11 10:16 AM
‎2010 Nov 11 10:33 AM
The rules of the forum state that you need to re.ward the posts that helped you achieve your goal. This will help others who search to arrive at the solution. If you do not do this excercise, all your future posts will be locked!
pk