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

Function Module does not fetch value

Former Member
0 Likes
1,963

Hi All,

I am using the fm RV_PRICE_PRINT_HEAD to fetch condition records. When I run this fm in SE37 for a particular document(vbeln) number, the values are fetched correctly into the internal tables TKOMV and TKOMVD.

The same fm does not fetch values when I run for second time for the same document(vbeln). This means :

1) I will go to SE37, type RV_PRICE_PRINT_HEAD, supply the export parameters in COMM_HEAD_I, execute it and obtain the condition records (Till this time absolutely fine)

2) Now, press Back (F3), Let the export parameters in "COMM_HEAD_I" will remain same. Just press Execute (F8). Then condition values are not fetched.

Could any body help in this regard...

Thanks

Thimmappa Hegde

6 REPLIES 6
Read only

Former Member
0 Likes
1,084

hi thimmappa,

try saving the values in test data directory and for the next test, access it from test data directory.

Regards,

Preema

Read only

Former Member
0 Likes
1,084

Hi

Welcome to SDN.

Use FM: RV_KONV_SELECT for retreiving condition details.

Pass 'X' for GENERAL_READ.

Here if you pass space it will work first time and wont work for the later immediate executions, whereas if you pass 'X' it will work for later executions too.

Please check the same.

Kind Regards

Eswar

Read only

0 Likes
1,084

Hi,

To be more specific,

I want to take out only the values of internal table "tkomvd" to obtain all header conditions for a document. That is why in I am using the fm "RV_PRICE_PRINT_HEAD" in my report program. This fm will fetch correct values when I run the report for first time. Where as the same fm does not fetch values when I run the same report with the same selection screen values.

But when I run the report again by typing the transaction SE38 and same selection screen values, the function module fetch the values in the internal table tkomvd.

Regards

Thimmappa

Read only

0 Likes
1,084

Hi

I have given you the other alternative bcoz there is a limitation while calling this FM: RV_PRICE_PRINT_HEAD.

If you see the comments and code of Include: LV61AA11, you can understand the problem.

<b>* mechanism to controll which conditions are already part of table TKOMV

  • Every time a pricing result is read from database the key is put into

  • TABGL. Also TABGL is updated if we've lines in TKOMV assigned to a

  • special key but entry in TABGL (case 2).

  • Originally TABGL was established to handle following pathological

  • case: condition successfully read from DB -> entry in TABGL. Then all

  • read conditions where deleted during processing (e.g. manually

  • deletion etc.). If we run into this routine again no records should

  • be redetermined from DB...</b>

read table tabgl with table key knumv = komk-knumv

transporting no fields.

  • Case 1:

  • conditions have been already read because there is a fitting entry in

  • TABGL. Exit immediately if caller doesn't want to force DB access.

  if sy-subrc eq 0. ---><b> First time SY-SUBRC NE 0 so no problem</b>    
     if generell_lesen ne 'X'. <b>--> Later runs SY-SUBRC  eq 0 and generell_lesen value is SPACE</b>.
        exit.
    endif.
  else.

Hope this clarifies your doubt now.

Kind Regards

Eswar

Read only

Former Member
0 Likes
1,084

Use this function module to initialize the price print buffer before calling RV_PRICE_PRINT_HEAD.

CALL FUNCTION 'RV_PRICE_PRINT_GET_BUFFER'

EXPORTING

i_print_from_buffer = 'A'.

Regards

Volker

Read only

0 Likes
1,084

Hi,

I had the same issue. The problem, as said before more or less, is that once you read the records from BBDD you can't read them from again on the same session. You just gotta read them from buffer instead using this FM:

RV_PRICE_PRINT_HEAD_BUFFER

Though Volker's way works using SE37 to execute the FM's, I couln't make it work on an Abap program.

I think this could be marked as "Answered".

Regards.

Edited by: John Smith on Feb 14, 2011 5:24 PM