2013 Jul 02 1:13 PM
Hi,
I want ekbe-ebeln and bsik-ebeln in one column.
Can anyone suggest the solution.
IF it_with_item-blart EQ 'RE'.
SELECT SINGLE ebeln gjahr belnr
FROM ekbe INTO (it_with_item-ebeln,it_with_item-gjahr1,it_with_item-belnr1)
WHERE gjahr = it_with_item-awkey+10(4) AND belnr = it_with_item-awkey(10).
MODIFY it_with_item TRANSPORTING:ebeln.
ENDIF.
READ TABLE it_bsik WITH KEY bukrs = it_with_item-bukrs belnr = it_with_item-belnr gjahr = it_with_item-gjahr.
IF sy-subrc = 0.
it_with_item-ebeln = it_bsik-ebeln.
it_with_item-zuonr = it_bsik-zuonr.
MODIFY it_with_item TRANSPORTING:ebeln,zuonr.
ENDIF.
Regards
Kalpana
2013 Jul 03 9:50 AM
Hi,
I solved my problem using If.. else condition.
IF it_with_item-blart EQ 'RE'.
SELECT SINGLE ebeln gjahr belnr
FROM ekbe INTO (it_with_item-ebeln,it_with_item-gjahr1,it_with_item-belnr1)
WHERE gjahr = it_with_item-awkey+10(4) AND belnr = it_with_item-awkey(10).
MODIFY it_with_item TRANSPORTING:ebeln.
ELSE.
READ TABLE it_bsik WITH KEY bukrs = it_with_item-bukrs belnr = it_with_item-belnr gjahr = it_with_item-gjahr.
IF sy-subrc = 0.
it_with_item-ebeln = it_bsik-ebeln.
it_with_item-zuonr = it_bsik-zuonr.
MODIFY it_with_item TRANSPORTING:ebeln,zuonr.
ENDIF.
ENDIF.
Now both ebeln's will be displayed under one column.
Regards
Kalpana
Hi,
I solved my problem using If.. else condition.
IF it_with_item-blart EQ 'RE'.
SELECT SINGLE ebeln gjahr belnr
FROM ekbe INTO (it_with_item-ebeln,it_with_item-gjahr1,it_with_item-belnr1)
WHERE gjahr = it_with_item-awkey+10(4) AND belnr = it_with_item-awkey(10).
MODIFY it_with_item TRANSPORTING:ebeln.
ELSE.
READ TABLE it_bsik WITH KEY bukrs = it_with_item-bukrs belnr = it_with_item-belnr gjahr = it_with_item-gjahr.
IF sy-subrc = 0.
it_with_item-ebeln = it_bsik-ebeln.
it_with_item-zuonr = it_bsik-zuonr.
MODIFY it_with_item TRANSPORTING:ebeln,zuonr.
ENDIF.
ENDIF.
Now both ebeln's will be displayed under one column.
Regards
Kalpana
2013 Jul 02 1:17 PM
Hi Kalpana,
Use concatenate to merge them with conversion exit alpha input before concatenating
output field should be char 20.
2013 Jul 02 1:19 PM
2013 Jul 02 1:24 PM
Hi Kalpana,
if you need to put directly the data using the SELECT statement, you could specify only the structure, not each field. For that, you need to have the fields in the begin of the structure, in the correct order ...
if you need to put it in a table, as Mohammed said, you made a loop, and make a concatenate to merge the two field in one.
concatenate ebeln1 ebeln2 into ebeln.
regards
Fred
2013 Jul 02 1:32 PM
Hi Kalpana
In your it_table (internal table) where you store the resultant data, you need to add one more column with length of 25.
Then based on your code,
READ TABLE it_bsik WITH KEY bukrs = it_with_item-bukrs belnr = it_with_item-belnr gjahr = it_with_item-gjahr.
IF sy-subrc = 0.
it_with_item-ebeln = it_bsik-ebeln.
it_with_item-zuonr = it_bsik-zuonr.
CONCATENATE it_bsik-ebeln it_with_item-ebeln INTO it_with_item-your_new_field
SEPARATED BY '-'.
MODIFY it_with_item TRANSPORTING: it_with_item-your_new_field.
ENDIF.
Regards,
Venkat
2013 Jul 02 1:44 PM
Hi venkateswaran,
I want fields row by row in a column.
According to u, it stores data side by side i.e., in a same row.
2013 Jul 02 1:48 PM
Maybe clarify your question ...
loop at itab_data where ebeln2 ne space.
move itab_data-ebeln2 to is_Data-ebeln1.
append is_data to itab_data.
endloop.
2013 Jul 02 1:59 PM
Hi Kalpana,
TYPES: BEGIN OF ty_ekbe,
ebeln TYPE ekbe-ebeln,
ebelp TYPE ekbe-ebelp,
END OF ty_ekbe,
BEGIN OF ty_bsik,
bukrs TYPE bsik-bukrs,
ebeln TYPE bsik-ebeln,
END OF ty_bsik,
BEGIN OF ty_ekbe1,
ebeln(20) TYPE c,
ebelp TYPE ekbe-ebelp,
bukrs TYPE bsik-bukrs,
END OF ty_ekbe1.
DATA: it_ekbe TYPE STANDARD TABLE OF ty_ekbe,
it_bsik TYPE STANDARD TABLE OF ty_bsik,
it_ekbe1 TYPE STANDARD TABLE OF ty_ekbe1,
wa_ekbe TYPE ty_ekbe,
wa_ekbe1 TYPE ty_ekbe1,
wa_bsik TYPE ty_bsik,
lv_idx TYPE sy-index.
wa_ekbe-ebeln = '4500017330'.
wa_ekbe-ebelp = '00010'.
APPEND wa_ekbe to it_ekbe.
wa_ekbe-ebeln = '4500017331'.
wa_ekbe-ebelp = '00020'.
APPEND wa_ekbe to it_ekbe.
wa_bsik-bukrs = '100'.
wa_bsik-ebeln = '4500017332'.
APPEND wa_bsik to it_bsik.
wa_bsik-bukrs = '100'.
wa_bsik-ebeln = '4500017333'.
APPEND wa_bsik to it_bsik.
LOOP AT it_ekbe INTO wa_ekbe.
if wa_ekbe is not INITIAL.
lv_idx = sy-tabix.
READ TABLE it_bsik INTO wa_bsik INDEX lv_idx.
CONCATENATE wa_ekbe-ebeln wa_bsik-ebeln INTO wa_ekbe1-ebeln SEPARATED BY space.
wa_ekbe1-ebelp = wa_ekbe-ebelp.
wa_ekbe1-bukrs = wa_bsik-bukrs.
APPEND wa_ekbe1 to it_ekbe1.
CLEAR lv_idx.
ENDIF.
ENDLOOP.
If suppose both internal table have the same ebeln number the you just use with key instead of index.
Hope this will helpful to you.
Thank You.
2013 Jul 03 9:50 AM
Hi,
I solved my problem using If.. else condition.
IF it_with_item-blart EQ 'RE'.
SELECT SINGLE ebeln gjahr belnr
FROM ekbe INTO (it_with_item-ebeln,it_with_item-gjahr1,it_with_item-belnr1)
WHERE gjahr = it_with_item-awkey+10(4) AND belnr = it_with_item-awkey(10).
MODIFY it_with_item TRANSPORTING:ebeln.
ELSE.
READ TABLE it_bsik WITH KEY bukrs = it_with_item-bukrs belnr = it_with_item-belnr gjahr = it_with_item-gjahr.
IF sy-subrc = 0.
it_with_item-ebeln = it_bsik-ebeln.
it_with_item-zuonr = it_bsik-zuonr.
MODIFY it_with_item TRANSPORTING:ebeln,zuonr.
ENDIF.
ENDIF.
Now both ebeln's will be displayed under one column.
Regards
Kalpana
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |