‎2007 Jul 16 7:01 AM
Hi abapers ,
I have Three input fields (Company Code,House Bank and Account ID) when I execute the report I need to enter valid input values.
1)For house bank the valid values are limited to only those relevent for the Company code,if provided.Additionally the matchcode may populate Company Code in addition to House Bank.
2).For Account Id the valid values should be limited to only those relevent for the Company code and House bank combination provided.The valid values are limited to only those relevent for the Company code and House bank.if provided.Additionally if the Company code and House Bank are blank and an Account id matchcode is use the company code and House bank should be updated in addition to the Account ID.
Please give me a sample code for this
Thanks
Nani
‎2007 Jul 16 7:08 AM
Hi
Declare those 3 fields on selection screen
and validate them against their master tables:
BUKRS: company code validate it against T001
House Bank and Account ID : validate against T012 Table
so that all the 3 fields are validated since this table have Company code,Bankid and account id
see the sample code and do similarly
select-options:s_bukrs for t001-bukrs.
at selection-screen.
Validation for company code
clear t001.
if not s_bukrs-low is initial.
select single bukrs from t001
into t001-bukrs
where bukrs in s_bukrs.
if sy-subrc <> 0.
message e007. " Enter valid Company Code
endif.
endif.
<b>Reward points for useful Answers</b>
Regards
Anji
‎2007 Jul 16 7:22 AM
Hi anji,
Validation i was done already.but when we are enter Account ID , automatically remaining fields (House Bank and Company code) should be updated in addintion to the Account ID. valid values of Company code and House bank updated at selection screen input.
Thanks
Nani
‎2007 Jul 16 7:09 AM
Hi,
This may help you:
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
*SELECT-OPTIONS : s_blart FOR bkpf-blart OBLIGATORY NO INTERVALS.
SELECT-OPTIONS s_blart FOR t003-blart MATCHCODE OBJECT zdoc_type OBLIGATORY NO INTERVALS NO-EXTENSION.
PARAMETERS: p_belnr LIKE bseg-belnr,
b_bukrs LIKE bseg-bukrs OBLIGATORY DEFAULT '1000',
g_gjahr LIKE bseg-gjahr.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_belnr.
DESCRIBE TABLE it_hlp LINES wk_lines.
IF wk_lines = 0.
SELECT belnr gjahr bldat budat INTO CORRESPONDING FIELDS OF it_hlp
FROM bkpf
WHERE bukrs = b_bukrs AND
bstat = ' ' AND
blart IN s_blart.
APPEND it_hlp.
ENDSELECT.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'BELNR'
dynprofield = 'P_BELNR'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
TABLES
value_tab = it_hlp.
Reward if useful!