Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete the entry from dropdown list in the pop up window in ALV report

Former Member
0 Kudos

Hi All,

I have a requirement in the ALV interactive report ZMM_IMPL .If we enter selection screen parameters its displaying the first screen.If we click on 'Goods Issue' tab ,it display the pop up window for Requirement Pick list with Batch number ,Storage location and Quantity.Here we have F4 option for batch number(MCH1-CHARG) and we could see all batches (with stock and without stock) in the drop down.

Now my requirement is i would need to delete the non stock batches from drop down values.

Ex:we clich F4 in batch number field(CHARG) ,could see 4 batches Test1 ,Test2 ,Test3 and Test4 .Here Test1 ,Test2 are Batch stock and other two are Non stock batches. We could see all these batches (with and without stock) in MCHB table.Now i would need to delete non stock batches(Batch with zero qty (MCHB-CLABS = 0) from drop down.

Any idea on this.

Regards,

Rpn

6 REPLIES 6

Former Member
0 Kudos

Hi RPN,

Kindly let us know why do you need to delete the batches ?

Why cant you filter it based on the some condition before the popup using some search help exit ?

Please be elaborate of the issue

0 Kudos

Hi,

User wants to appear only batches with stock value in the drop down .Here Batches test1, test2 , test3 have stock but test4 has no stock value. Now the requirement is if stock does not exist in any of those batches it should not appear in the drop down and propose batches based on quantity.

Batch stock value can be seen through transaction MB52 and could see only Test1.Test2 and Test3.

They have arleady code in the program for F4 help to Batch number as following,

CLEAR: lips.

REFRESH: gt_lips.

lips-vbeln = f_vbeln.

lips-posnr = f_posnr.

lips-matnr = f_matnr.

lips-werks = f_werks.

lips-lfimg = f_bdmng. "store the requirement quantity for display

lips-pstyv = f_res_del. "use to store RES or DEL "DV1K919143

CALL SCREEN '0100' STARTING AT 10 2.

  • for the ok code to be BT_SAVE all the validation are complete

IF g_ok_code NE 'BT_SAVE'.

f_answer = 'A'.

ENDIF.

The logic for screen '0100' as follows

PROCESS BEFORE OUTPUT.

*&spwizard: pbo flow logic for tablecontrol 'TC_LIPS'

module TC_LIPS_change_tc_attr.

*&spwizard: module TC_LIPS_change_col_attr.

loop at GT_LIPS

into GS_LIPS

with control TC_LIPS

cursor TC_LIPS-current_line.

module TC_LIPS_get_lines.

*&spwizard: module TC_LIPS_change_field_attr

endloop.

MODULE STATUS_0100.

*

PROCESS AFTER INPUT.

*&spwizard: pai flow logic for tablecontrol 'TC_LIPS'

loop at GT_LIPS.

chain.

field GS_LIPS-CHARG.

field GS_LIPS-LGORT.

field GS_LIPS-LFIMG.

module TC_LIPS_modify on chain-request.

endchain.

field GS_LIPS-SELKZ

module TC_LIPS_mark on request.

endloop.

module TC_LIPS_user_command.

*&spwizard: module TC_LIPS_change_tc_attr.

*&spwizard: module TC_LIPS_change_col_attr.

MODULE USER_COMMAND_0100.

MODULE USER_COMMAND_EXIT_0100 AT EXIT-COMMAND.

process on value-request.

field gs_lips-charg module lips-charg_values.

Logic for F4 help as following

DATA: mc_object LIKE dd23l-mconame,

help_lips LIKE lips.

DATA: dseltab LIKE dselc OCCURS 10 WITH HEADER LINE.

DATA: lf_shlpname LIKE dd30v-shlpname,

lx_shlp TYPE shlp_descr_t,

ls_interface LIKE ddshiface,

lf_rc LIKE sy-subrc,

lt_retvalues LIKE ddshretval OCCURS 0,

ls_retvalue LIKE ddshretval.

help_lips = lips.

IF NOT help_lips-matnr IS INITIAL.

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'

EXPORTING

input = help_lips-matnr

IMPORTING

output = help_lips-matnr

EXCEPTIONS

length_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • exit. "Ignore conversion errors "50A

ENDIF.

ELSE.

EXIT.

ENDIF.

SET PARAMETER ID 'MAT' FIELD help_lips-matnr.

SET PARAMETER ID 'WRK' FIELD help_lips-werks.

  • Export parameters to memory to enable search help via classes

CLEAR dseltab.

REFRESH dseltab.

dseltab-fldname = 'MANDT'.

MOVE sy-mandt TO dseltab-fldinh.

APPEND dseltab.

dseltab-fldname = 'MATNR'.

MOVE help_lips-matnr TO dseltab-fldinh.

APPEND dseltab.

dseltab-fldname = 'WERKS'.

MOVE help_lips-werks TO dseltab-fldinh.

APPEND dseltab.

dseltab-fldname = 'CHARG'.

MOVE help_lips-charg TO dseltab-fldinh.

APPEND dseltab.

EXPORT dseltab TO MEMORY ID 'DSELTAB'.

  • Get description for search help

mc_object = 'MCH1'.

lf_shlpname = mc_object.

CALL FUNCTION 'F4IF_GET_SHLP_DESCR'

EXPORTING

shlpname = lf_shlpname

shlptype = 'SH'

IMPORTING

shlp = lx_shlp

EXCEPTIONS

OTHERS = 1.

  • Enable value copy from search help to dynpro field

READ TABLE lx_shlp-interface INTO ls_interface

WITH KEY shlpfield = 'CHARG'.

ls_interface-valfield = 'X'.

MODIFY lx_shlp-interface FROM ls_interface INDEX sy-tabix.

  • Start search help dialog

CALL FUNCTION 'F4IF_START_VALUE_REQUEST'

EXPORTING

shlp = lx_shlp

TABLES

return_values = lt_retvalues

EXCEPTIONS

OTHERS = 1.

IF sy-subrc EQ 0.

READ TABLE lt_retvalues INTO ls_retvalue

WITH KEY fieldname = 'CHARG'.

IF sy-subrc EQ 0.

lips-charg = ls_retvalue-fieldval.

gs_lips-charg = ls_retvalue-fieldval.

ENDIF.

ENDIF.

How to delete entry from F4 help.Any idea?

Regards,

Reddy

Former Member
0 Kudos

Hi Guys,

Any idea on this,how to delete entry from all possible values F4 help?

Regards,

Rpn

Former Member
0 Kudos

Hi,

why don't you check the value of CLABS in the internal table, before you proceed with passing it for the search help function module?

The point is, delete entrees with CLABS(or whichever field you are talking about) = 0 and pass the internal table which contains only the desired values, to the search help function module.

lemme know if that works fine for you.

Thanks and Regards,

Shiny

Former Member
0 Kudos

Hi Shiny,

Thanks for your reply.

They have already coded for F4 help and they were used these FM:F4IF_GET_SHLP_DESCR' and FM:'F4IF_START_VALUE_REQUEST' for F4 help. if I pass internal table data ITAB to the these Function modules ,the program getting dump.

Please let me know any other option to solve this issue.

Regards,

Rpn

0 Kudos

Hi RPN,

those function modules don't really accept internal tables as parameters. You may use F4IF_FIELD_VALUE_REQUEST instead. This is meant for F4 help for fields that are only known at runtime. So, before passing your internal table to this function module, delete the unwanted values from it (Assuming that you want to display the values of the internal table in the search help).

Hope this helps you.

Thanks and Regards,

Shiny