on 06-04-2014 9:05 PM
step 1: Create WEB DYNPRO component. Example: Zwd_assist_class_test.
-save.
-Active.
step 2: Assistance class on component(Zwd_assist_class_test) screenwriter assist class name Example:Asistance_class.
step3: Select the Assistance class name click on pop up new window .
step4:Assistance class window methods give method name
step5: Select parameters of the methods giving importing exporting table ,objects.
step6:Select Attributes button given the attribute name Example:ET_MAR.
For example methods READ_ONLY.
coding for method: select * from <db_table> into table <ET_tab> where matnr between im_matnr1 and im_matnr2.
I want using MARA,VBAK,VBAP tables data display in single table,creating two search fields .these are VBELN, MATNR
how to write READ_ONLY method ?
Hi Rajasekhar,
how to write READ_ONLY method ?
What do you mean by READ_ONLY method? I wonder if there is concept "READ ONLY METHOD".
Hope your requirement is to create a method in assistance class to read data from database tables based on input fields.
Proceed as below to achieve your requirement
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Assistance class methods:
methods: Read_data level: Instance visible : public.
Importing parameters:
matnr: im_matnr1 ,im_matnr2. MARA table.
vbeln: im_vbeln1 , im_vbeln2 VBAK table.
Exporting Parameters:
lt_mara type mara.
lt_vbak type vbak
lt_vbap type vbap.
method read_data( ).
*** MARA TABLE***
select * from mara into table et_mara where matnr between im_matnr1 and im_matnr2.
***VBAP TABLE***
select * from vbap into table et_vbap for all entries in et_mara
where matnr = et_mara-matnr and
vbeln between im_vbeln1 and im_vbeln2.
***VBAK TABLE***
select * from vbak into table et_vbak for all entries in et_vbap
where vbeln = et_vbap-vbeln
end method.
Hi Rajasekhar,
The exporting parameters which you have declared can take only one record as its declared as work area. Instead you need to identify the table type and use like
for MARA... MARA_TT
for VBAK... VBAK_T
for VBAP... VBAP_T
but, for your requirement, you need not required to pass mara, vbak, vbap table data, instead you need to put into final internal table ET_result.
I suggest you to create a table type ZTT_RESULT in SE11 which contains all your fields in the output.
Now, inside READ_DATA( ) method you can do as below ( just an example)
loop at lt_mara into ls_mara.
move-corresponding ls_mara to ls_result.
loop at lt_vbap into ls_vbap where matnr = ls_mara-vbeln.
move-corresponding ls_vbap to ls_result.
read table lt_vbak into ls_vbak with key vbeln = ls_vbap-vbeln.
if sy-subrc is initial.
move-corresponding ls_vbak to ls_result.
endif.
endloop.
append ls_result to ET_RESULT.
endloop.
Hope this helps you.
Regards,
Rama
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If i'm not wrong,you want to fetch data from MARA,VBAK,VBAP into single table?..If so, Create an itab will all the required fields from three tables and also create 3 temp itabs.
1) Fetch data from Table-1 based on your requirement/selection criteria into itab1.
2) Fetch data from Table-2 based on entires of itab1 into itab2.
3) Fetch data from Table-3 based on entires of itab2 into itab3.
Now you have data in Itab1,Itab2,Itab3. Use these three itab's and populate the data into final Itab(which you want to use to finally).
Thanks
KH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.