10-26-2007 11:46 AM
hi,
i have a requirement for that i have to split the vakey form konh.but the structure of that vakey is different for different tables.if i split that it should work for all the tables how can i do that?
10-26-2007 1:51 PM
Hi,
concatenate KONH-KVEWE and KONH-KOTABNR. With this key you read table DD03L, order by POSITION. Gives you fieldnames, keys, position, and length of tablefields. The first two keyfields (except client) are always KONH-KAPPL and KONH-KSCHL. The rest of the key is found in KONH-VAKEY. For actual structure see result of your DD03L search.
Jo
10-26-2007 4:13 PM
*Obtain the condition table name
CONCATENATE c_kote fp_curr_kotabnr INTO l_tabname.
Select key fields for the current condition table
SELECT fieldname leng position
FROM dd03l
INTO CORRESPONDING FIELDS OF TABLE fp_key_fields
WHERE tabname = l_tabname
AND keyflag = c_x
...................
...................
LOOP AT fp_i_key_fields INTO l_rec_key_fields.
l_length = l_rec_key_fields-leng.
l_fieldvalue = fp_rec_konh-vakey+l_offset(l_length).
l_offset = l_offset + l_length.
............
............
ENDLOOP.
Hope it helps you.
10-26-2007 4:20 PM
Please reward points for useful answer and close the thread if answered.