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

hitting a database table in a requirement routine

Former Member
0 Likes
1,108

hi all,

i have to edit a requirement routine in which i am supposed to retrieve data frem the database table VBAP. This routine runs dynamically when a transaction is executed.

My question is, can we hit a database table inside a requirement routine?

please provide me valid reasons if the answer is no, and if the answer is yes, please give me some examples.

Thank you

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
918

routine is just a piece of code that will be hit... so it can contain any code.. even the code to hit the database table as well..

in the routine source code just put some select statement... according to ur requirement..

select vbeln parvw from vbap
       into {lv_vbeln lv_parvw)
   where <condition>

award points if helpful

hi all,

i have to edit a requirement routine in which i am supposed to retrieve data frem the database table VBAP. This routine runs dynamically when a transaction is executed.

My question is, can we hit a database table inside a requirement routine?

please provide me valid reasons if the answer is no, and if the answer is yes, please give me some examples.

Thank you

5 REPLIES 5
Read only

former_member156446
Active Contributor
0 Likes
919

routine is just a piece of code that will be hit... so it can contain any code.. even the code to hit the database table as well..

in the routine source code just put some select statement... according to ur requirement..

select vbeln parvw from vbap
       into {lv_vbeln lv_parvw)
   where <condition>

award points if helpful

Read only

Former Member
0 Likes
918

hi jay,

This requirement routine is RV61B620 which is setup in the access sequence of an output type.

only structures are used in the code presently. can u give an example of such code where a database table has been used.

Thanks

Read only

0 Likes
918

check if this might help u

IF you have 3 different access sequences for one condition record then in a pricing procedure in what hierarchy will you maintain the three accesses?

In Condition Records (T Code VK11), you would be putting values to corresponding Condition Types. Now one Condition Type can be assigned to one access sequence. In Access Sequence, you can assign whichever tables and fields are required.

So in my opinion, you cannot have one condition record for 3 access sequences.

What happens in the access sequence when you put all the ticks in the exclusive field?

When you put tick in exclusive field of all access sequences, in my opinion, it will try to get available data from the first. Only in case, data is not available, will it move on to the next one.

Read only

Former Member
0 Likes
918

so, u mean to say that we can use a database table ?

i am new to all these terms like condition table and access sequences,

i would be very greatful if u cud explain it in a more elaborate way.

thanks

Read only

0 Likes
918

Q: I have a requirement to write a routine. I have to store Material and Sub Material values to an internal table ITAB from /BIO/PMATERIAL table with comparing to

Data package-material but I need to write only materials which are not equal to sub material because Most of the cases material and sub materials are same.

Material is a primary key in the table and sub material is an attribute of Material and condtion is Material NE Sub Material.

How do I write a routine?


TYPE : BEGIN OF TY_MATERIAL,
MATERIAL LIKE /BI0/PMATERIAL-MATERIAL,
SUB_MATERIAL LIKE /BI0/PMATERIAL-SUB_MATERIAL,
END OF TY_MATERIAL.

DATA : WA_MATERIAL TYPE TY_MATERIAL,
ITAB_MATERIAL TYPE TY_MATERIAL OCCURS 0.

SELECT <material sub_material>
from /BI0/PMATERIAL
INTO TABLE ITAB_MATERIAL
FOR ALL ENTRIES OF DATA_PACKAGE
WHERE MATERIAL EQ DATA_PACKAGE-MATERIAL.

LOOP AT ITAB_MATERIAL INTO WA_MATERIAL.

IF WA_MATERIAL = WA_SUB_MATERIAL.

DELETE ITAB_MATERIAL.

ENDIF.

CLEAR WA_MATERIAL.

ENDLOOP.

check this links:

;&#56993;

;&#56897;

;&#57259;

;&#56443;

;&#56595;