Application Development 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: 

Select query to VBFA is giving dump : zsales report

former_member220286
Participant

zsdb-1.jpgzsdb-2.jpgzsdb-gst-3.jpgzsdb-gst-4.jpgzsdb-gst-5.jpgDear All,

I have a requirement that in one of the sales report select query to

VBFA going to dump .

SELECT VBELN POSNR FKIMG VRKME VGBEL AUBEL MATNR ARKTX CHARG WERKS
KONDM VKAUS FROM VBRP INTO TABLE IT_VBRP FOR ALL ENTRIES IN IT_VBRK
WHERE VBELN = IT_VBRK-VBELN
AND MATNR IN S_MAT
AND SPART IN P_SPART
AND CHARG IN S_CHARG
AND WERKS IN P_WERKS
AND KONDM IN S_MATNR .

IF SY-SUBRC NE 0.
MESSAGE 'No Data Found' TYPE 'I'.
LEAVE LIST-PROCESSING.
ENDIF.

" The below query is going to dump .

SELECT VBELV VBELN POSNN VBTYP_N VBTYP_V FROM VBFA INTO TABLE IT_VBFA FOR ALL ENTRIES IN IT_VBRP WHERE VBELN = IT_VBRP-AUBEL AND POSNN = IT_VBRP-POSNR AND VBTYP_N = 'C' AND VBTYP_V = 'G'.

Please suggest any ideas or workaround why the query to VBFA going for dump .

I have attached the screenshots of the Error message I am getting after the dump .

Regards

Deep

13 REPLIES 13

former_member564522
Active Participant
0 Kudos

Please attached screenshots of the dump.

former_member220286
Participant
0 Kudos

Dear All,

I have attached the screenshots of the dump .Please check .

Regards

Deep

Pradeep_Reddy
Participant
0 Kudos

Dear Deep

It is a time out error, check with u r basis team how much time they allocate for exexcution

0 Kudos

check this parameter rdisp/max_wprun_time in rz11

0 Kudos

Dear Pradeep Reddy ,

I can understand that it is a time out error .

The current setting is 2400 seconds as per the dump log from ST22.

I think it will be around more than half an hour .

Please guide now . I am running this report for all plants , distribution channels and divisions and invoice date period is around 1 year . ( 01.04.2014 to 31.03.2015 ) .

I have attached the screen shots above to original post .Please check time is reflecting over there .Also one query it is showing for dump on VBFA .Please suggest and ideas or workaround .

Regards

Deep

Try like below

SELECT VBELV VBELN POSNN VBTYP_N VBTYP_V FROM VBFA INTO TABLE IT_VBFA FOR ALL ENTRIES IN IT_VBRP WHERE VBELN = IT_VBRP-AUBEL AND POSNN = IT_VBRP-POSNR AND VBTYP_N = 'C' .

above query have primary fields.

delete IT_VBFA where VBTYP_V <> 'G'.

0 Kudos

Dear Pradeep Reddy ,

On passing the inputs in standard table VBFA : Sales Document Flow .

I am following the below query : -

SELECT VBELN POSNR FKIMG VRKME VGBEL AUBEL MATNR ARKTX CHARG WERKS KONDM VKAUS FROM VBRP INTO TABLE IT_VBRP FOR ALL ENTRIES IN IT_VBRK WHERE VBELN = IT_VBRK-VBELN AND MATNR IN S_MAT AND SPART IN P_SPART AND CHARG IN S_CHARG AND WERKS IN P_WERKS AND KONDM IN S_MATNR .

IF SY-SUBRC NE 0.

MESSAGE 'No Data Found' TYPE 'I'.

LEAVE LIST-PROCESSING.

ENDIF.

SELECT VBELV VBELN POSNN VBTYP_N VBTYP_V FROM VBFA INTO TABLE IT_VBFA FOR ALL ENTRIES IN IT_VBRP WHERE VBELN = IT_VBRP-AUBEL AND POSNN = IT_VBRP-POSNR AND VBTYP_N = 'C' AND VBTYP_V = 'G'.

While debugging I saved the data which I get from the It_vbrp table in excel file and manually entered the values of the AUBEL , POSNR , VBTYP_N and VBTYP_V in the standard table ( in se11) VBFA .

So I am passing entries which I get from the IT_VBRP table into the standard table VBFA in SE11 to check the records . I am passing IT_VBRP-AUBEL in field VBELN and IT_VBRP-POSNR in field POSNN of the table VBFA .

Also two more parameters VBTYP_N = 'C' AND VBTYP_V = 'G' in table VBFA .

vbfa-1.jpgvbfa-3.jpg

The standard table is giving the dump . I have attached the dump logs . I am unable to understand that why the standard table : VBFA is giving the dump .

Regards

Deep

DoanManhQuynh
Active Contributor

Hello.

Did you try inner join yet?

Your DB is too heavy that make SQL timeout. you may need setting on timeout parameter or you can run that query in background.

matt
Active Contributor
0 Kudos

Correct.

INNER JOINS are in most cases faster than FOR ALL ENTRIES.

First thing to do is change the SQL to an INNER JOIN. If you still get a time out, then either run the program in background, or use a smaller selection and run multiple times.

However, changing the timeout parameter is a hiding to nothing. Eventually the data volume will cause the runtime to exceed the new value. Timeouts are set for a reason. Increasing it is not something to do lightly and certainly not for a single program.

roberto_forti
Contributor
0 Kudos

Hi Deep,

1. Are you sure about retrieving VBFA-VBELN equal VBRP-AUBEL (sales document) as a subsequent ?

2. Can you check the corresponding "Sales Document Flow" - transaction VA03 ?

Let me know.

Regards,



0 Kudos

Dear ROBERTO Forti Santos ,

One more issue is that on passing the inputs in standard table VBFA : Sales Document Flow .

I am following the below query : -

SELECT VBELN POSNR FKIMG VRKME VGBEL AUBEL MATNR ARKTX CHARG WERKS KONDM VKAUS FROM VBRP INTO TABLE IT_VBRP FOR ALL ENTRIES IN IT_VBRK WHERE VBELN = IT_VBRK-VBELN AND MATNR IN S_MAT AND SPART IN P_SPART AND CHARG IN S_CHARG AND WERKS IN P_WERKS AND KONDM IN S_MATNR .

IF SY-SUBRC NE 0.

MESSAGE 'No Data Found' TYPE 'I'.

LEAVE LIST-PROCESSING.

ENDIF.

SELECT VBELV VBELN POSNN VBTYP_N VBTYP_V FROM VBFA INTO TABLE IT_VBFA FOR ALL ENTRIES IN IT_VBRP WHERE VBELN = IT_VBRP-AUBEL AND POSNN = IT_VBRP-POSNR AND VBTYP_N = 'C' AND VBTYP_V = 'G'.

While debugging I saved the data which I get from the It_vbrp table in excel file and manually entered the values of the AUBEL , POSNR , VBTYP_N and VBTYP_V in the standard table ( in se11) VBFA .

So I am passing entries which I get from the IT_VBRP table into the standard table VBFA in SE11 to check the records . I am passing IT_VBRP-AUBEL in field VBELN and IT_VBRP-POSNR in field POSNN of the table VBFA .

Also two more parameters VBTYP_N = 'C' AND VBTYP_V = 'G' in table VBFA .

The standard table is giving the dump . I have attached the dump logs . I am unable to understand that why the standard table : VBFA is giving the dump .

Regards Deep

former_member283640
Participant
0 Kudos

Hi Deep,

You can try move IT_VBRP one range as below. Will take it same dump?

And how much record this table IT_VBRP ?

SELECT VBELV VBELN POSNN VBTYP_N VBTYP_V FROM VBFA

INTO TABLE IT_VBFA WHERE VBELN IN R_AUBEL.

matt
Active Contributor
0 Kudos

Please post your other dump as a separate question. On the grounds that your original question seems to be resolved, I'm closing this one now.