Quantcast
Channel: SCN: Message List - ABAP Testing and Troubleshooting
Viewing all 1418 articles
Browse latest View live

BADI displays error but still allow saving of Contract in RECN

$
0
0

Hi,

 

I've been working on adding a validation in tcode RECN where i will prompt an error message if a certain field has no value. After adding my code to IF_EX_RECN_CONTRACT~CHECK_ALL method of ZBADI_RECN_CONTRACT_IN implementation, the error displays correctly but still allow the contract to be saved.

 

I don't know if this is affected by the upgrade of the system to a newer enhancement package.

 

I would really appreciate any tips.

 

Thanks in advance,

 

Rod


Re: SELECT COUNT(*) FROM VBAK-VBAP-VBUK - performance

$
0
0

try to use the database view : VBAKUK

 

and do you have values in u_vbeln, if not and if you intend to do the selection via material only then use VAPMA instead of vbap.

Re: SELECT COUNT(*) FROM VBAK-VBAP-VBUK - performance

$
0
0

Thank you Kartik.

 

I tried to use VBAKUK Like this.

 

    SELECT COUNT(*)

      FROM VBAKUK AS ak                                      "販売伝票:ヘッダデータ

     INNER JOIN vbap AS ap                                 "販売伝票:明細データ

     ON ak~vbeln = ap~vbeln

      INTO vl_count

           FOR ALL ENTRIES IN  tl_matnr

    -------

 

But VBAKUK doest't have VBAP-Endusrponum and  VBAK-Aedat, VBAK - Needtoapproveflg.

 

And I use  have values in u_vbeln.

Re: SELECT COUNT(*) FROM VBAK-VBAP-VBUK - performance

$
0
0

Can you check if VAPMA has all the fields that you need, since you are accessing VBAP primarily with MATNR

 

Add in where clause vbap-vbeln as well. can you take a SQL trace n post the screenshot

 

Message was edited by: Kartik Tarla

Re: SELECT COUNT(*) FROM VBAK-VBAP-VBUK - performance

$
0
0

Also I would suggest to use open SQL, get contents in internal table and then use DESCRIBE TABLE to get the count

Re: SELECT COUNT(*) FROM VBAK-VBAP-VBUK - performance

$
0
0

To access VBAP from material number, you must there use VAPMA (Read also 185530 - Performance: Customer developments in SD) add this table in the JOIN list.


Also move as much  where criteria to this single table.

 

SELECT COUNT(*)
FROM vapma AS ma
INNER JOIN vbap AS ap  ON ap~vbeln = ma~vbeln
JOIN vbak AS ak  ON ak~vbeln = ap~vbeln
INNER JOIN vbuk AS uk  ON uk~vbeln = ak~vbeln
INTO vl_count
FOR ALL ENTRIES IN  tl_matnr
WHERE ma~matnr = tl_matnr-matnr  AND ma~vbeln IN u_vbeln  AND ma~vkorg IN u_vkorg  AND ma~vkbur IN u_vkbur  AND ma~vkgrp IN u_vkgrp  AND ap~kdmat IN u_kdmat  AND ap~pstyv IN u_pstyv  AND ap~lgort IN u_lgort  AND ap~invoicenum IN u_invono  AND ap~lastitemchangeuser IN u_chuser  AND ap~ktgrm IN u_ktgrm  AND ap~ps_psp_pnr IN tl_rpspnr  AND ak~auart IN u_auart  AND ak~kunnr IN u_kunso  AND ak~endusrponum IN u_enduno  AND ak~erdat IN u_erdat  AND ak~ernam IN u_ernam  AND ak~aedat IN u_aedat  AND ak~lifsk IN u_lifsk  AND ak~faksk IN u_faksk  AND ap~abgru IN u_abgru  AND ak~augru IN u_augru  AND ak~needtoapproveflg IN u_appflg  AND uk~lfstk IN u_lfstk.

Regards,

Raymond

Re: Getting timeout error

$
0
0

Hi Nagireddy,

 

If you are getting this runtime error due to internal table storage space (you will see "No more storage space available for exceeding internal table" in this case) then you can proceed with below options:

 

1. Try to avoid fetching unwanted fields if you there are any.

2. Each program will have some limitation to deal with data volume. Hence, optimize your code by checking if program is holding data in any other unwanted tables.

3. If you are modifying selected data at later part of program with COLLECT or other stetements, which can minimize the record count, then check if you can do  samething at SELECT query level with aggregate functions like SUM.

4. Last but not least, this is where most of the storage issues will be resolved. Use cursors (OPEN, FETCH, CLOSE) with appropriate package size and get smaller chucks data into internal table and process it.

Package size can be determized based on the size of each record in your table.

If you are not confortable with fetching data into internal table due control break events or for some other reason then you can get into work area or field symbols.

 

Now, if you are getting this runtime error not because of storage issues then it could be cut-off time that your system has for fore-ground execution. 

 

1. You need to use lightweight WHERE condition (with Indexes if possible). Share your WHERE condtion with SCN, if possible.

2. If everything is fine (field orders, selection of required fields etc.,) then you should check for alternate architecture to display this data (Back executions, Multiple screens, Additional Filters)

 

Regards,

Naveen

Re: Optimization Issue

$
0
0

Alex sir, thank you. I think this will work but one thing can you also do for me...

 

Can you do declaration of field symbols how it needs to be done with my scenario please?


Also, Material is the only key that I have in my standard database table ok. so, i don't know how to use this WHERE clause for ZZMATERIAL and where.  I have not created any index on my standard database table, do you think i should create the index for ZZMATERIAL?


Re: Optimization Issue

$
0
0
Can you do declaration of field symbols how it needs to be done with my scenario please?

It will be something like this:

 

FIELD-SYMBOLS: <fs_int> LIKE LINE OF int_tab. " or use actual type of the int_tab work area

 

LOOP AT int_tab ASSIGNING <fs_int>.

   ... " Use <fs_int> instead of wa_int, the rest of the code is the same

ENDLOOP.

 

Also, Material is the only key that I have in my standard database table ok. so, i don't know how to use this WHERE clause for ZZMATERIAL and where.  I have not created any index on my standard database table, do you think i should create the index for ZZMATERIAL?

If ZZMATERIAL is a part of the primary key, then it's already included in the index. I believe SAP OpenSQL subsystem should be wise enough to generate a proper WHERE clause that will make use of that index.

 

Just in case, you may check the SQL queries actually issued when updates are performed. To do this, just run the SQL tracing from the debugger as described here.

Re: Optimization Issue

$
0
0

Thank you Sir Alex, I will try this and let you know how it works. also, i have another internal table in which I have a field called ZZSTORE. In that table which is called "int_tab_str" which has a work are as well. I have ZZMATERIAL and ZZSTORE as fields.

 

In that second internal table, my data lies like this:

ZZMATERIAL    ZZSTORE

101                    CTDPS

102                    CRGPD

103                    SEHTY

104                    CAUFG

 

I need to merge that table to int_tab so I can bring ZZSTORE field in my int_tab.  From there I can take all these fields and send them to it_std_tab and finally append to my final standard database table.


I am thinking about creating third final table in which I will have fields from Internal Table 1 and Internal Table 2 (ZZSTORE).

then I will do

SELECT * FROM INTERNAL TABLE 2

FOR ALL ENTRIES IN INTERNAL TABLE 1

WHERE ZZMATERIAL = INTERNAL TABLE 1-ZZMATERIAL.


LOOP AT INTERNAL TABLE 1

LOOP AT INTERNAL TABLE 2 WHERE ZZMATERIAL = ITAB1-ZZMATERIAL.


Here i think i will have to fill my third table but i do not know how.


ENDLOOP.

ENDLOOP.



Once this code is good then i need to know where to place this code in my scenario code. Please let me know.

Thanks.

Re: Optimization Issue

$
0
0

As far as I understand, the relation between store and material is 1:M. In this case I would just add a ZZSTORE field to the 1st table definition and then just fetch stores while looping over it. See the sample code below:

 

DATA l_wa_store LIKE LINE OF int_tab_2.


SORT int_tab_2 BY zzmaterial.


LOOP AT int_tab ASSIGNING <fs_int>.

  READ TABLE int_tab_2 INTO l_wa_store

    WITH KEY zzmaterial = <fs_mseg>-zzmaterial BINARY SEARCH.


  IF sy-subrc = 0.

    <fs_int>-zzstore = l_wa_store-zzstore.

  ENDIF.


  " The code we've discussed earlier goes below

  ...

ENDLOOP.

Performance and BAPI

$
0
0

Hi Gurus.

 

I'm select data from kna1 and adrc i need fields :

 

City1     

Region   

Street    

house_num1

house_num2

Post_code1

ADDRNUMBER

 

 

The people told me the bapi Has a better performance, then i used the 'BAPI_CUSTOMER_GETLIST'

it has all fields except house_num2.

 

What is the best solution for perfomance?

 

1- use the bapi and after select only the house_num2 field  by select or

Don´t use the bapi and use only select?

 

 

Thanks for help.

ABAP internal table

$
0
0


Is it possible to use MODIFY statement on an internal table with no entries?

 

Modify itab index 1 from wa1.

 

Above statement is not populating itab even though entries r there in wa1.

 

Thanks,

Tanvi

Re: ABAP internal table

Re: ABAP internal table

$
0
0

Hi,

 

The given statement will not work because the index 1 doesn't exist in an empty internal table.

And I'm wondering why this statement didn't cause any dump, as you are trying to access/modify a location that does not exist.

 

And we can modify an internal table with respect to a key or index. But in an empty internal table there is  no key/index available to compare and modify.

 

If we want to know the internal table is empty or not, we can read the table with index 1 or key( if you want to check the existence of a particular entry .) Then perform the further processing according to the value of sy-subrc.

 

Regards

Jesse Owens K


Re: ABAP internal table

$
0
0

It does not create a dump because it simply sets sy-subrc to 4 if it cannot find the specified table line. To better test if the table is empty, we can either use:

 

itab[] IS INITIAL

 

or

 

lines( itab ) = 0

 

BR,

Serban

Re: Performance and BAPI

Re: Getting timeout error

$
0
0

Hi

You could check with the basis tem the property "vdisp/max_wprun_time      for maximum time".

This property says the time limit of aplications .

For example in my company is 15 minutes if my select is more than 15 minutes then occurs dump by time out , maybe they can help.

 

Other way is user the commit before big process because this cammand clear the "vdisp/max_wprun_time      for maximum time.

 

For example if you is executing a select and "vdisp/max_wprun_time      for maximum time is 10 minutes

if you use commit before the "vdisp/max_wprun_time      for maximum time   is clear and begin again.


YOu could use the st05 transaction to see the time of your select and compare with "vdisp/max_wprun_time      for maximum time.

SAP access in consolut

$
0
0

Hi,

 

     I am new for abap. and i am registered in portal.consolut and i am get user id and password for ERP E62 Client 400, 500 & 800, ERP E66 Client 300, 500 & 800 and for BI while i am trying to create a program in SE38 in client 800 it saying 'You are not authorized to make changes' and '(authorization object S_DEVELOP)' can anybody please sent a replay for my message where i have to create custom programs.here i am sending clients information.

 

ERP E62:

Client 300: Not to use at all - it is needed for internal purpose only

Client 400: Customizing, but overwritten frequently at any issue

Client 500: Customizing, but planned to be longterm (Except "nobody" can work at all)

Client 800: Demo/Education: This client typically gets "never" overwritten, but you can only post documents and cannot do your own customizing. This client is perfect for your training, when you want to post and put some data into the system

Re: ABAP internal table

$
0
0

Hi,

 

You internal table is empty and you are trying to modify internal table with work area. As the table is empty, it should add records to internal table from work area. It is not populating any record to internal table because you are using 'Index' clasue in modify statement. Here, there is no index as internal table is initial. Try to remove 'Index' from that statement.

Viewing all 1418 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>