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: 

Add column

Former Member
0 Kudos

Hi all,

If I want to add 2 new field : mtbez from ty_summary and xrate from ty_summaryc to itab table, may I know what should I do? How am I going to declare it? Currently the output display in normal report and I want to add another option for alv report . For the alv report all output data will store in itab.

Below is the existing code before i do any enchancement:

DATA: BEGIN OF itab OCCURS 0,

lifnr LIKE lfa1-lifnr, " vendor no

xblnr LIKE rbkp-xblnr, " inv no

matnr LIKE ekpo-matnr, " part no

ebeln LIKE rseg-ebeln, " order no

land1 LIKE lfa1-land1, " Vendor's Country SN001+

wemng LIKE ekbez-wemng, " rcv-qty

menge LIKE mseg-menge, " str-qty

uprice(9) TYPE p DECIMALS 4, " unit-price

waers LIKE rbkp-waers, " cur

wrbtr LIKE rseg-wrbtr, " amount

kursf LIKE rbkp-kursf, " rate

belnr LIKE rbkp-belnr, " inv doc no

buzei LIKE rseg-buzei, kursf_c(13),

END OF itab.

TYPES: BEGIN OF ty_summary.

TYPES: landx LIKE t005t-landx,

mtbez LIKE t134t-mtbez,

prdha LIKE mara-prdha,

knttp LIKE ekpo-knttp,

mtart LIKE mara-mtart.

INCLUDE STRUCTURE itab.

TYPES: END OF ty_summary.

TYPES: BEGIN OF ty_summaryc.

TYPES: curr LIKE rbkp-waers,

mtbez LIKE t134t-mtbez,

prdha LIKE mara-prdha,

knttp LIKE ekpo-knttp,

mtart LIKE mara-mtart,

xrate(10).

INCLUDE STRUCTURE itab.

TYPES: END OF ty_summaryc.

Many thanks!!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You can add mtbez in itab itself as it is common in both ty_summary and ty_summaryc. Add field XRATE at the end , and if it is not necessary in ty_summary let it be, wont create any problem for you.

DATA: BEGIN OF itab OCCURS 0,

lifnr LIKE lfa1-lifnr, " vendor no

xblnr LIKE rbkp-xblnr, " inv no

matnr LIKE ekpo-matnr, " part no

ebeln LIKE rseg-ebeln, " order no

land1 LIKE lfa1-land1, " Vendor's Country SN001+

wemng LIKE ekbez-wemng, " rcv-qty

menge LIKE mseg-menge, " str-qty

uprice(9) TYPE p DECIMALS 4, " unit-price

waers LIKE rbkp-waers, " cur

wrbtr LIKE rseg-wrbtr, " amount

kursf LIKE rbkp-kursf, " rate

belnr LIKE rbkp-belnr, " inv doc no

buzei LIKE rseg-buzei, kursf_c(13),

mtbez LIKE t134t-mtbez, (insert this line)

xrate(10) . " Insert this line

END OF itab.

TYPES: BEGIN OF ty_summary.

TYPES: landx LIKE t005t-landx,

mtbez LIKE t134t-mtbez, Delete this line

prdha LIKE mara-prdha,

knttp LIKE ekpo-knttp,

mtart LIKE mara-mtart.

INCLUDE STRUCTURE itab.

TYPES: END OF ty_summary.

TYPES: BEGIN OF ty_summaryc.

TYPES: curr LIKE rbkp-waers,

mtbez LIKE t134t-mtbez, delete this line

prdha LIKE mara-prdha,

knttp LIKE ekpo-knttp,

mtart LIKE mara-mtart,

xrate(10). " Delete this line

INCLUDE STRUCTURE itab.

TYPES: END OF ty_summaryc.

Hope your problem solved here

Regards,

Antony thomas

Edited by: Antony Thomas on Jul 22, 2010 11:54 AM

2 REPLIES 2

Former Member
0 Kudos

Hi,

Declare like this.

DATA: BEGIN OF itab OCCURS 0,

lifnr LIKE lfa1-lifnr, " vendor no

xblnr LIKE rbkp-xblnr, " inv no

matnr LIKE ekpo-matnr, " part no

ebeln LIKE rseg-ebeln, " order no

land1 LIKE lfa1-land1, " Vendor's Country SN001+

wemng LIKE ekbez-wemng, " rcv-qty

menge LIKE mseg-menge, " str-qty

uprice(9) TYPE p DECIMALS 4, " unit-price

waers LIKE rbkp-waers, " cur

wrbtr LIKE rseg-wrbtr, " amount

kursf LIKE rbkp-kursf, " rate

belnr LIKE rbkp-belnr, " inv doc no

buzei LIKE rseg-buzei, kursf_c(13),

mtbez LIKE t134t-mtbez,

xrate(10) type c.

END OF itab.

Former Member
0 Kudos

You can add mtbez in itab itself as it is common in both ty_summary and ty_summaryc. Add field XRATE at the end , and if it is not necessary in ty_summary let it be, wont create any problem for you.

DATA: BEGIN OF itab OCCURS 0,

lifnr LIKE lfa1-lifnr, " vendor no

xblnr LIKE rbkp-xblnr, " inv no

matnr LIKE ekpo-matnr, " part no

ebeln LIKE rseg-ebeln, " order no

land1 LIKE lfa1-land1, " Vendor's Country SN001+

wemng LIKE ekbez-wemng, " rcv-qty

menge LIKE mseg-menge, " str-qty

uprice(9) TYPE p DECIMALS 4, " unit-price

waers LIKE rbkp-waers, " cur

wrbtr LIKE rseg-wrbtr, " amount

kursf LIKE rbkp-kursf, " rate

belnr LIKE rbkp-belnr, " inv doc no

buzei LIKE rseg-buzei, kursf_c(13),

mtbez LIKE t134t-mtbez, (insert this line)

xrate(10) . " Insert this line

END OF itab.

TYPES: BEGIN OF ty_summary.

TYPES: landx LIKE t005t-landx,

mtbez LIKE t134t-mtbez, Delete this line

prdha LIKE mara-prdha,

knttp LIKE ekpo-knttp,

mtart LIKE mara-mtart.

INCLUDE STRUCTURE itab.

TYPES: END OF ty_summary.

TYPES: BEGIN OF ty_summaryc.

TYPES: curr LIKE rbkp-waers,

mtbez LIKE t134t-mtbez, delete this line

prdha LIKE mara-prdha,

knttp LIKE ekpo-knttp,

mtart LIKE mara-mtart,

xrate(10). " Delete this line

INCLUDE STRUCTURE itab.

TYPES: END OF ty_summaryc.

Hope your problem solved here

Regards,

Antony thomas

Edited by: Antony Thomas on Jul 22, 2010 11:54 AM