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

logic needed

Former Member
0 Likes
544

Hi

i extracted data from TEMKSV table, and i need to upload the data (T_TEMKSV) in to Ztable.

my Ztable already having entries. Ztable having 2 filelds(OLD_OPBEL, NEW_OPBEL)

using the condition Old_opbel = OLDKEY,New_opbel = NEWKEY.

How to do this? Pls help.

Points will reward soon

SELECT * FROM TEMKSV INTO TABLE T_TEMKSV

WHERE FIRMA = 'SPS' AND OBJECT = 'DOCUMENT_Q'.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
507

HI

Loop At T_TEMKSV .

Do the checking as per ur reqmt..

Ztable-Old_opbel = 'pass val here'

Ztable-New_opbel = 'pass val here'

Append ztable.

Endloop .

Hope it helps.

Praveen

4 REPLIES 4
Read only

Former Member
0 Likes
507

Hi,

now u can use modify keyword.

see sample code,

PARAMETERS p_carrid TYPE scarr-carrid.

DATA scarr_tab TYPE SORTED TABLE OF scarr

WITH UNIQUE KEY carrid.

DATA scarr_wa TYPE scarr.

SELECT *

FROM scarr

INTO TABLE scarr_tab.

READ TABLE scarr_tab INTO scarr_wa

WITH TABLE KEY carrid = p_carrid.

scarr_wa-currcode = 'EUR'.

MODIFY TABLE scarr_tab FROM scarr_wa

TRANSPORTING currcode.

seshu.

Read only

Former Member
0 Likes
507

Hi,

MODIFY TEMKSV FROM TABLE itab.

Inserts new lines or updates existing lines in a database table (s. relational database). If a line with the specified primary key already exists, an UPDATE is executed. Otherwise, an INSERT is performed.

Read only

0 Likes
507

Hi

following is my code. how to check the condition Old_opbel = OLDKEY New_opbel = NEWKEY ?

TABLES : ZFIPY_OPBEL_MAP.

DATA : T_TEMKSV TYPE STANDARD TABLE OF TEMKSV WITH HEADER LINE.

DATA : counta type i,

countb type i.

SELECT * FROM TEMKSV INTO TABLE T_TEMKSV

WHERE FIRMA = 'SPS' AND OBJECT = 'DOCUMENT_Q'.

DESCRIBE TABLE T_TEMKSV lines counta.

IF T_TEMKSV IS NOT INITIAL.

INSERT ZFIPY_OPBEL_MAP

FROM TABLE T_TEMKSV.

ENDIF.

select count(*) from ZFIPY_OPBEL_MAP into countb.

write : / countb.

Read only

Former Member
0 Likes
508

HI

Loop At T_TEMKSV .

Do the checking as per ur reqmt..

Ztable-Old_opbel = 'pass val here'

Ztable-New_opbel = 'pass val here'

Append ztable.

Endloop .

Hope it helps.

Praveen