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: 

concatenation of EKPO-EBELN and EKPO-EBELP into a variable

Former Member
0 Kudos

how can i concatenate the purchase document no (EKPO-EBELN) and item number (EKPO-EBELP) into a variable of type THEAD-TDNAME so that i can pass that variable into the FM 'READ_TEXT' .

when i try , it doest concatenate cuz EKPO-EBELN is a CHAR and EKPO-EBELP is a NUMC .

plz help me out..

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate

Not sure what you mean, this works fine.



REPORT ZRICH_0002 .

data: xekpo type ekpo.
data: name type THEAD-TDNAME .


select Single * from ekpo into xekpo.


concatenate xekpo-ebeln xekpo-ebelp into name.


write:/ name.

Regards,

Rich Heilman

17 REPLIES 17

Former Member
0 Kudos

hii

use concatenate

i tried it .it is working.

DATA :V_EBELN LIKE EKPO-EBELN ,

V_EBELP LIKE EKPO-EBELP ,

V_1 TYPE THEAD-TDNAME .

V_EBELN = 4500000000 .

V_EBELP = 01025 .

CONCATENATE V_EBELN V_EBELP INTO V_1.

WRITE:/ V_1 .

hope this helps

Thanks & Regards

Naresh

LucianoBentiveg
Active Contributor
0 Kudos

First make:

data: lc_ebelp(5) TYPE c.

write ekpo-ebelp to lc_ebelp.

concatenate ekpo-ebeln lc_ebelp into THEAD-TDNAME.

Regards.

guillaume-hrc
Active Contributor
0 Kudos

Hi,

Use a temporary CHAR field to store content of EKPO-EBELP and then concatenate the two in THEAD-TDNAME.

That should be OK that way.

Best regards,

Guillaume

Former Member
0 Kudos

DATA : V_POSNR(6) TYPE C.

WRITE 😕 EKPO-POSNR TO v_posnr.

then use concatenate

concatenate EKKO-EBELN

V_POSNR

INTO V_TDOBJECT.

0 Kudos

Hi,

Try this piece of code,

Data : V1 like EKPO-EBELN VALUE '4300069136',

V2 LIKE EKPO-EBELP VALUE '00010',

V3 LIKE THEAD-TDNAME.

CONCATENATE V1 V2 INTO V3.

WRITE V3.

Hope it may help.

Thanks,

Mayank

RichHeilman
Developer Advocate
Developer Advocate

Not sure what you mean, this works fine.



REPORT ZRICH_0002 .

data: xekpo type ekpo.
data: name type THEAD-TDNAME .


select Single * from ekpo into xekpo.


concatenate xekpo-ebeln xekpo-ebelp into name.


write:/ name.

Regards,

Rich Heilman

Former Member
0 Kudos

hi


data : v_ebelp type string.
v_ebelp = ekpo-ebelp.
concatenate ekpo-vbeln v_ebelp into v_ebelp.

plz reward helpful posts

Former Member
0 Kudos

This code works just fine.

tables: ekko, ekpo, thead.

select single * from ekko.

select single * from ekpo where ebeln = ekko-ebeln.

concatenate ekko-ebeln ekpo-EBELP into thead-tdname.

write:/ thead-tdname.

CONCATENATE handles CHAR and NUMC just fine. Your issue is elsewhere.

What error are you receiving?

0 Kudos

Hi John,

i am doing,

concatenate ekko-ebeln ekpo-EBELP into txt.

where 'txt' is of type THEAD-TDNAME

i am getting a dialog box displaying that the FM 'READ_TEXT' cant accept '450000001700000'

where 4500000017 is ekko-ebeln , but ekpo-ebelp is 00000

??

0 Kudos

Shehryar,

"00000" is not a valid value for EKPO-EBELP.

Please post your code for review.

0 Kudos

Data: txt TYPE THEAD-TDNAME,

mpotext TYPE string.

Types: ty_textobject type standard table of tline.

Data: itab TYPE TY_TEXTOBJECT,

wa_itab TYPE TLINE.

concatenate ekko-ebeln ekpo-EBELP into txt.

CALL FUNCTION 'READ_TEXT' " FM Read_text

EXPORTING

ID = 'F03'

LANGUAGE = 'E'

NAME = txt

OBJECT = 'EKPO'

TABLES

LINES = itab

EXCEPTIONS

ID = 1.

IF SY-SUBRC <> 0.

ENDIF.

LOOP at itab into wa_itab.

mpotext = wa_itab-tdline.

endloop.

0 Kudos

Please include the code that populates EKKO-EBELN and EKPO-EBELP.

Also - Is your dialog box (error message) at compilation ? Or at run-time?

0 Kudos

its at compilation..

0 Kudos

Please include the code that populates EKKO-EBELN and EKPO-EBELP.

A value of '00000' in EKPO-EBELP is incorrect.

0 Kudos

Shehryar,

I am confused. You said that the error is a compile error.

However, you have values for EKKO-EBELN and EKPO-EBELP.

Are these "hard-coded" into your source code?

Former Member
0 Kudos

Shehryar,

Where do you stand with this? Need more help still?

If yes, please provide the additional info cited.

If not, please reward points accordingly and close the thread.

Thanks!!

0 Kudos

Thanks John and everyone else,

i had to write the value after the table loop .. thanks.