2009 Jan 06 11:09 AM
Hi! Frnds,
At selection-screen am having three fields with F4 Functional 1) Company Code 2)Accounting Document Number 3)Fiscal year. when press f4 on company code depending on the company code selected it should fillter the Accounting Document Number. Based on Accounting Document Number Selected Fiscal year should be fillted. Please help me to find this...........thanks
2009 Jan 06 11:26 AM
try like this...
PERFORM read_dynprofield USING '<TABLE-FIELD_NAME>'
CHANGING ytdsrate-tax_type.
SELECT DISTINCT tax_code
INTO CORRESPONDING FIELDS OF TABLE itAB
FROM <TABLE>
WHERE tax_type EQ <TABLE-FIELD_NAME>
AND mark_for_del NE 'X'
.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = '<FIELD_NAME>
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = '<TABLE-FIELD_NAME>'
value_org = 'S'
TABLES
value_tab = itAB
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
ENDIF.
*&---------------------------------------------------------------------*
*& Form READ_DYNPROFIELD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0387 text
* <--P_YTDSRATE_TAX_TYPE text
*----------------------------------------------------------------------*
FORM read_dynprofield USING p_fieldname
CHANGING p_value.
DATA it_dynfield TYPE STANDARD TABLE OF dynpread WITH HEADER LINE.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
request = 'A'
translate_to_upper = 'X'
TABLES
dynpfields = it_dynfield
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
READ TABLE it_dynfield WITH KEY fieldname = p_fieldname.
p_value = it_dynfield-fieldvalue.
ENDFORM. " READ_DYNPROFIELD
Hi! Frnds,
At selection-screen am having three fields with F4 Functional 1) Company Code 2)Accounting Document Number 3)Fiscal year. when press f4 on company code depending on the company code selected it should fillter the Accounting Document Number. Based on Accounting Document Number Selected Fiscal year should be fillted. Please help me to find this...........thanks
2009 Jan 06 11:13 AM
hi,
write thi scode at selection-screen.
DATA: lt_status TYPE STANDARD TABLE OF ZST_CRM_DN_STAUS,
lt_return TYPE STANDARD TABLE OF DDSHRETVAL,
ls_return TYPE DDSHRETVAL.
CLEAR: ls_return.
*select status with description
SELECT estat
txt30
FROM tj30t
INTO TABLE lt_status
WHERE stsma = p_spfile.
*F4 help also returning the value to be displayed in internal table
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = 'ZST_CRM_DN_STAUS'
RETFIELD = 'ESTAT'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = lt_status
RETURN_TAB = lt_return
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
IF SY-SUBRC = 0.
READ TABLE lt_return INTO ls_return INDEX 1.
IF sy-subrc = 0.
CONDENSE ls_return-fieldval.
p_status = ls_return-fieldval.
ENDIF.
ENDIF.
2009 Jan 06 11:18 AM
hi,
you can create a search help from Se11 to achieve it.
SEARCH in SCN you have lot of posts about how to create Search help
2009 Jan 06 11:23 AM
Hi,
I think the following piece of work will help u..
Keep look at the Functional module.
selection-screen begin of block input with frame title text-000.
select-options: it_matnr for wa_output-matnr no intervals.
parameters: p_werks type marc-werks,
p_plgscn type tcx0l-plscn.
selection-screen end of block input .
initialization.
Initializing select-options variables
gv_w_opt_list-name = c_a.
gv_w_opt_list-options-eq = c_x.
append gv_w_opt_list to gv_w_res-opt_list_tab.
gv_w_ass-kind = c_a.
gv_w_ass-name = c_ass_name.
gv_w_ass-op_main = c_a.
gv_w_ass-sg_main = c_ass_sg_main.
append gv_w_ass to gv_w_res-ass_tab.
It allows to restrict intervals for select-options in selection screen
call function 'SELECT_OPTIONS_RESTRICT'
exporting
program = sy-repid
restriction = gv_w_res
exceptions
too_late = 1
repeated = 2
selopt_without_options = 3
selopt_without_signs = 4
invalid_sign = 5
empty_option_list = 6
invalid_kind = 7
repeated_kind_a = 8
others = 9.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
I hope it ll help u.
<removed_by_moderator>
Thanks.
Edited by: Julius Bussche on Jan 6, 2009 12:44 PM
2009 Jan 06 11:25 AM
Hello Balaji,
1) Company Code 2)Accounting Document Number 3)Fiscal year. when press f4 on company code depending on the company code selected it should fillter the Accounting Document Number. Based on Accounting Document Number Selected Fiscal year should be fillted
As for the 1st F4 help, plz search SDN sufficient posts are available.
Why do you need "Fiscal year based on a/c'ing doc selected"? Even std. SAP doesnot provide help for fiscal year, does not make sense to me.
BR,
Suhas
2009 Jan 06 11:26 AM
try like this...
PERFORM read_dynprofield USING '<TABLE-FIELD_NAME>'
CHANGING ytdsrate-tax_type.
SELECT DISTINCT tax_code
INTO CORRESPONDING FIELDS OF TABLE itAB
FROM <TABLE>
WHERE tax_type EQ <TABLE-FIELD_NAME>
AND mark_for_del NE 'X'
.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = '<FIELD_NAME>
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = '<TABLE-FIELD_NAME>'
value_org = 'S'
TABLES
value_tab = itAB
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
ENDIF.
*&---------------------------------------------------------------------*
*& Form READ_DYNPROFIELD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0387 text
* <--P_YTDSRATE_TAX_TYPE text
*----------------------------------------------------------------------*
FORM read_dynprofield USING p_fieldname
CHANGING p_value.
DATA it_dynfield TYPE STANDARD TABLE OF dynpread WITH HEADER LINE.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
request = 'A'
translate_to_upper = 'X'
TABLES
dynpfields = it_dynfield
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
READ TABLE it_dynfield WITH KEY fieldname = p_fieldname.
p_value = it_dynfield-fieldvalue.
ENDFORM. " READ_DYNPROFIELD
2009 Jan 06 11:53 AM
hi,
Following Code will help you out in this way in the bellow code i am selecting the RSM With Respect to Customer and then select ASM the People under RSM and then CR the all People under ASM,
Hope this will help you lot.
data: i_return type ddshretval occurs 0 with header line,
c type c value 'S'.
* Search Help for RSM
at selection-screen on value-request for sorsmid-low.
types: begin of t_sh_rsmid,
rsmid like zsdo-rsmid,
ename like pa0001-ename,
end of t_sh_rsmid.
data: it_sh_rsmid type standard table of t_sh_rsmid with header line.
select distinct zsdo~rsmid pa0001~ename
into corresponding fields of table it_sh_rsmid
from zsdo left outer join pa0001 on ( zsdo~rsmid = pa0001~pernr and pa0001~endda = '99991231' )
where zsdo~kunnr in sokunnr.
delete it_sh_rsmid where rsmid = '00000000'.
sort it_sh_rsmid by rsmid.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'RSMID'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'rsmid'
value_org = c
tables
value_tab = it_sh_rsmid
return_tab = i_return.
* Search Help for ASM
at selection-screen on value-request for soasmid-low.
types: begin of t_sh_asmid,
asmid like zsdo-asmid,
ename like pa0001-ename,
end of t_sh_asmid.
data: it_sh_asmid type standard table of t_sh_asmid with header line.
select distinct zsdo~asmid pa0001~ename
into corresponding fields of table it_sh_asmid
from zsdo left outer join pa0001 on ( zsdo~asmid = pa0001~pernr and pa0001~endda = '99991231' )
where zsdo~kunnr in sokunnr.
delete it_sh_asmid where asmid = '00000000'.
sort it_sh_asmid by asmid.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'ASMID'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'asmid'
value_org = c
tables
value_tab = it_sh_asmid
return_tab = i_return.
* Search Help for CR
at selection-screen on value-request for socrid-low.
types: begin of t_sh_crid,
crid like zsdo-crid,
ename like pa0001-ename,
end of t_sh_crid.
data: it_sh_crid type standard table of t_sh_crid with header line.
select distinct zsdo~crid pa0001~ename
into corresponding fields of table it_sh_crid
from zsdo left outer join pa0001 on ( zsdo~crid = pa0001~pernr and pa0001~endda = '99991231' )
where zsdo~kunnr in sokunnr.
delete it_sh_crid where crid = '00000000'.
loop at it_sh_crid into it_sh_crid where crid <> '' and ename = ''.
count_loop = sy-tabix.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = it_sh_crid-crid
importing
output = it_sh_crid-crid.
select single ename from pa0001 into it_sh_crid-ename where pernr = it_sh_crid-crid.
modify it_sh_crid from it_sh_crid index count_loop.
endloop.
sort it_sh_crid by crid.
delete adjacent duplicates from it_sh_crid comparing all fields.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'CRID'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'crid'
value_org = c
tables
value_tab = it_sh_crid
return_tab = i_return.Replay if any problem,
Kind Regards,
Faisal
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |