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

Append structure to a table with foreign key

Former Member
0 Likes
1,384

i have a table /hjk/zsfdhjdkk and in the table there is a field "cthno" (with dataelement ZMB_CTHOEN) and for this field there is foreign key relationship with table "ztarntyu" ( with field "cthno").So it was working well in the program(doing foreign key check and also a pop up is appearing).

Now i have "Appended" a structure "zwedwrwew" for the above table and in the structure i have added a field "mcthno" (with dataelement ZMB_CTHOEN) and for this field i have given foreign key relationship with the above table "ztarntyu" ( with field "cthno").Activated the structure & table.

Now the problem is in the program,for the field "mcthno" the pop up is not appearing and also its not doing foreign key check.

what may be the error i have done.

My requirement is a search help from table "ztarntyu" and foreign key check with "ztarntyu".

Can anyone give me a solution?

Thanks & Regards

Shaik Sajid

i have a table /hjk/zsfdhjdkk and in the table there is a field "cthno" (with dataelement ZMB_CTHOEN) and for this field there is foreign key relationship with table "ztarntyu" ( with field "cthno").So it was working well in the program(doing foreign key check and also a pop up is appearing).

Now i have "Appended" a structure "zwedwrwew" for the above table and in the structure i have added a field "mcthno" (with dataelement ZMB_CTHOEN) and for this field i have given foreign key relationship with the above table "ztarntyu" ( with field "cthno").Activated the structure & table.

Now the problem is in the program,for the field "mcthno" the pop up is not appearing and also its not doing foreign key check.

what may be the error i have done.

My requirement is a search help from table "ztarntyu" and foreign key check with "ztarntyu".

Can anyone give me a solution?

Thanks & Regards

Shaik Sajid

1 REPLY 1
Read only

Former Member
0 Likes
791

Hi Shaik,

Are u sure without appended structure, the foreign key check is working for u through program?....Actually if u r updating the table through program, u need to check the values against the primary key table manually. I hope it is not the problem with appended structure. And anyway if u are referring to that table filed, F4 help will come anyways. The foreign key check is performed when u r updating the table through se11 transaction.

U can go ahead like this with the program. In table YBSP1, I have a field userid and an appended structure field userid1. These two are foreign keys and are checked against field userid of YBSP .

PARAMETERS : name TYPE ybsp1-userid,

name1 TYPE ybsp1-userid1.

DATA : wa TYPE ybsp1.

DATA : itab TYPE STANDARD TABLE OF ybsp WITH HEADER LINE.

wa-userid = name.

wa-userid1 = name1.

SELECT * FROM ybsp INTO TABLE itab.

READ TABLE itab WITH KEY userid = name.

IF sy-subrc EQ 0.

READ TABLE itab WITH KEY userid = name1.

IF sy-subrc NE 0.

MESSAGE e000(zxxx) WITH 'Invalid'.

EXIT.

ENDIF.

ELSE.

MESSAGE e000(zxxx) WITH 'Invalid'.

EXIT.

ENDIF.

MODIFY ybsp1 FROM wa.

IF sy-subrc NE 0.

MESSAGE e000(zxxx) WITH 'Invalid'.

ENDIF.

-Hope this helps u.