Application Development and Automation 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: 
Read only

ALV Class

Former Member
0 Likes
473

Hi all

Please rewrite the below code to get the output using only ALV class.

REPORT ZALV_CLASS7.

data class1 type ref to cl_gui_alv_grid.

TYPES:BEGIN OF t_mat,

matnr TYPE mara-matnr,

werks TYPE marc-werks,

maktx TYPE makt-maktx,

END OF t_mat.

TYPES:BEGIN OF t_bseg,

bukrs TYPE bseg-bukrs,

blart TYPE bkpf-blart,

END OF t_bseg.

DATA:BEGIN OF it_final OCCURS 0,

matnr TYPE mara-matnr,

werks TYPE marc-werks,

maktx TYPE makt-maktx,

bukrs TYPE bseg-bukrs,

blart TYPE bkpf-blart,

END OF it_final.

DATA:it_mat TYPE STANDARD TABLE OF t_mat WITH HEADER LINE.

DATA:it_bseg TYPE STANDARD TABLE OF t_bseg WITH HEADER LINE.

START-OF-SELECTION.

SELECT * FROM mara INTO CORRESPONDING FIELDS OF TABLE

it_mat.

SELECT * FROM marc INTO CORRESPONDING FIELDS OF TABLE

it_mat .

SELECT * FROM bseg INTO CORRESPONDING FIELDS OF TABLE

it_bseg.

END-OF-SELECTION.

LOOP at it_final.

it_final-matnr = it_mat-matnr.

it_final-werks = it_mat-werks.

it_final-maktx = it_mat-maktx.

it_final-bukrs = it_bseg-bukrs.

it_final-blart = it_final-blart.

APPEND it_final.

ENDLOOP.

WIth Regards

Vijay.

3 REPLIES 3
Read only

Former Member
0 Likes
449

Please rewrite the below code to get the output using only ALV class.

How much buks you will give for rewriting your code?

Refer:

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/class%2balv

Amit.

Read only

Former Member
0 Likes
449

Hi,

No one is here to write your code, you have to write your own.

Follow this link for Procedure to write ALV using Class concept-

[ALV using Class Concept|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abap-7StepstocreateOOPSALV%28forbeginners%29&]

Regards,

Sujit

Read only

former_member69765
Contributor
0 Likes
449

Wow ... I've never seen some one so straight forward in asking people to do your job while you sit back and relax ...

As Amit said ... So how much do I get paid !!

Dude... If you try yourself ... you will learn something ..

If you take this approach .. then I don't think you will ever learn ABAP !!

An what will you tell your boss when he asks some questions back ?

And what if he is impressed and gives you another OO ALV report to write !! You will come back to SDN again !!

Well check out the some tutorials and code examples here ...

And then try it out yourself ..

Tutorials: http://www.abaplearning.com/abap-tutorials

Examples: http://www.abaplearning.com/abap-example-codes

And believe me ... there is nothing as pleasing when you see the output of your own written code... instead of running some one else's code !!

Cheers.