Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all 8332 articles
Browse latest View live

Screen number Change in FB02 & FB09 BDC Recording

$
0
0

Hi Experts,

 

 

I am want to update item text in T-code FB02 or may be in FB09 so for this purpose I have recorded the transaction through SHDB but the screen where i need to change the item text changes every time in recording, I thought it may be happening due to change in Account type (BSEG-KOART) field but that was not the case. I have even tried FM FI_DOCUMENT_CHANGE to do the same but through this FM the item text is changed for few document only not for all.

 

{code}

CALL FUNCTION 'FI_DOCUMENT_CHANGE'

   EXPORTING

     i_buzei              = indx              " BUEZEI " Item number

     i_bukrs              = wa_fb02-bukrs

     i_belnr              = wa_fb02-belnr

     i_gjahr              = wa_fb02-gjahr

   TABLES

     t_accchg             = t_accchg          " Feild name to be changed, Old & New Value

   EXCEPTIONS

     no_reference         = 1

     no_document          = 2

     many_documents       = 3

     wrong_input          = 4

     overwrite_creditcard = 5

     OTHERS               = 6.
{code}


Mouse over events on alv report?

$
0
0

Hello,

 

i want to make mouse over event for rows of a alv report.When mouse is on a row there will be shown explanations.

how can i do this?

thanks inn advance.

Issue in ABAP Unit Test

$
0
0

Hi,

 

I am having an issue in Unit Testing of Function Module. The issue is that Interface parameter of FM is not accessed in subroutine as the parameter goes like a field symbol. I get a dump while try to access the Interface parameter.

Can anyone please help me out on this.

Operational Analytics using ALV – A plain ABAP Approach

$
0
0

Hello SCN-Community,

 

as mentioned in my first blog „BRFplus in Big Data scenarios“, I want to share some other topics around processing mass amount of data. Faster as I expected I've solved a problem at a dialog for operational analysis. It’s about topic 3 of my last blog:

 

“Explorative search techniques to determine anomalies in invoices – how could we support the end user during his daily work? Can we use ALV grid to analyse data models with master-detail relationships?”

 

In this blog I want to describe a kind of analytics which can be compared to “looking for a needle in a haystack” or “exploring for something”. If you mention something unspecific and you don’t know how to name it, is it worth a try to build a data model in a Business Warehouse for example? How to describe this data model? To build such a model you have to do some explorative search first Mostly this work is done by an export of the related data and playing around with Excel or some kind of statistic software.
If you gained the knowledge of a specific fact in your data and you want to keep track of this constellation you may want to build a check function to reproduce it at any given time. - We do not want the user leave the system to do his work.
That’s what the blog is all about. How could the user be supported by an explorative search about anomalies in a operational analytics scenario without leaving the operational system? How could we place the facts of a done explorative search into a check which can be used to reproduce the search?

Introduction

We take place in the already discussed business case – Processing of a huge amount of invoices sent to a statutory health insurance company.

A set of checks is being processed every time new invoices arrive. Every check focuses on a specific aspect or constellation of an invoice which produce clarification cases that have to be analyzed by the end user. But these checks were developed due to a specific concept or aspect. So they target on the most common known anomalies in these invoices. What about other constellation which have not been considered before?

One solution to this problem may be a dialog in which the user can do some kind of pre analytics to seek for new patterns to identify anomalies, errors or even detect possible fraud cases among those invoices.

Requirements

This task sound easy. You take the invoices to look at and put them into an ALV-Grid. Due to that you can use all filters and sort criteria of the ALV-Grid. Also you are able to save your “query” for reuse as a user-specific layout.

At this point we'll need to raise some important aspects:

 

  • We have to deal with approximately 28.000.000 invoices a year for a single health insurance company. This amount of invoices does not fit into an ALV-Grid.
  • Each invoice is supported by some medical documentation. We have to be able to search in invoices for existence of a specific medical treatment, surgery and so on.
  • These filter criteria have to be saved like usual ALV variants due to reuse. Unfortunately we can’t use the normal ALV variants since we deal with master/detail views. So we have to develop different techniques which are major topic of this blog entry.
  • The user must be able to see all data of a specific invoice even the detail data.
  • Our solution cannot be addressed to HANA-specific techniques only. We have to support a kind of HANA-readiness without facing solution with a two different lines of code.

 

In this case we talk about a generic solution. With this tool the user is able to do an explorative search about billing errors in our scenario without moving into a Business Warehouse.

Introducing our UI prototype

In fact of the matter we cannot build upon HANA-specific features only we chose a solution with a standard ALV-Grid. We split the screen of the dialog into two sections. A master view with one ALV-Grid for displaying the invoices and a detail view containing three ALV-Grids corresponding to three kinds of supporting documentation.

BALV.jpg

If you double click an invoice all detail data is being loaded into the corresponding ALV-Grids.

Handling of mass data

We decided not to load all invoices into the ALV-Grid to avoid overloading the master view. During an explorative search you are not interested in each single invoice. Rather you have to find another filter to reduce the search result – to give your interest boundaries. For now we talk about an extract of the data (named as “Ausschnitt” in the screenshots) and the whole data of the underlying table (named as “Gesamtdaten”). The size of an extract is defined by the user. With the size of the extract the user decides how many invoices have to be displayed and thus are being transferred to the front-end. It’s a constraint to define the maximum amount of data. To gain this kind of truncation we added a new button to the ALV-Grid.

Count_Button.JPG

“Sätze” stands for rows or even invoices which defines a kind of truncation. The given filter and sort criteria of an ALV-Grid operates on the internal data table of the grid – so it only addresses the extract but operates very quickly.

If we want to reduce our search result effectively the filter and sort criteria are to operate on the whole underlying data table. Due to that we added some other functionality to the grid to control the ALV filter and sort actions.

Sort_Buttons.JPGFilter_Button.JPG

  • „Sortierung Ausschnitt“ : Sort the extract at the front-end (ALV-Grid standard)
  • „Sortierung Gesamtdaten" : Sort the data in backend (database) and rebuild the internal table (of the ALV)
  • „Filterung Ausschnitt“ : Filter the extract at the front-end (ALV-Grid standard)
  • „Filterung Gesamtdaten“ : Filter the data in backend and rebuild a new internal table on that result (of the ALV)

 

With the help of these new functions we are able to search for various facts in a huge amount of data. If the amount of data to be displayed is too big, we’ll see due to the truncation only the tip of the iceberg.

Detail filter – How to deal with them?

The search by detail data was a bigger problem we had to deal with. An ALV filter only operates on its own data context. But the detail data are separated in additional ALV-Grids. So we built a popup with additional filter criteria addressing the keys of the medical documentation we have to deal with.

Detail_Button.JPG

Detail_Filter.JPG

The constraints of the detail filter are handled by a manager class of our master view. Such a constraint is defined as a single Select-Option. This manager class builds upon these constraints a SQL query. We built all combinations of master to detail view as an EXISTS clause for each detail relationship. We count 8 valid combinations (guess 2^3 ) so the SQL queries can be hard coded in the manager class.

 

 

 

Detail A

 

 

EXISTS (MEDICAL

TREATMENTS)

 

 

Detail B

 

 

EXISTS (ICD)

 

 

Detail C

 

 

EXISTS

(SURGERIES)

XOO
XXO
XXX
XOX
OXX
OXO
OOX
OOO


Another problem was to take care of a detail filter while saving an ALV-layout in the master view. If the user defined a detail filter it has to be saved together with the normal layout. We solved this by creating an add-on table holding the detail filter under the same key of the ALV-layout. To do this we added some functionality in to the event handling of the ALV-Layout button. When the user loads a layout the detail filter is loaded too so the original search result is reproduced.

 

With these extensions to the ALV-Grid we realized a master to detail relationship with standard ABAP coding to allow the user to search explorative in the whole data volume.

Advanced techniques

With this solution we are not at the end. Due to use of Select-Option to define a detail filter we are not able to do all kinds of filtering. Suggest we want to keep track of all invoices containing the medical treatment A und B except C or D. With a Select-Option we are only to select via OR and not via AND.

 

Additionally we want to transform such a saved layout (with detail filter) to a customer defined check function which is being processed when a new invoice arrives. Under this condition we were faced with a major ABAP limit:

 

The 8 hard coded EXISTS clauses no longer match the new requirements. So we have to deal with a dynamic WHERE clause which does not support sub queries currently. We hit a dead end.

 

Without trying to use HANA-specific functionalities the only solutions we mentioned were the use of native-SQL or the generation of ABAP coding. We decided to choose the way of code generation. Our manager class is able to transform a saved ALV-layout with an applied detail filter into a SQL query. This built query gets embedded into a generated ABAP class which could be used in our operational analytics framework.

What should be better? – A wish list / Subject to Change

During the development of this dialog (which is based on the ALV-Grid class CL_GUI_ALV_GRID on NetWeaver 7.40 SP4) we also examined the use of the ALV-Grid with IDA (HANA-Grid class CL_SALV_GUI_TABLE_IDA on both NetWeaver 7.40 SP4 and SP6). We noticed the availability of this grid also on none HANA-Systems. That’s a very important fact. This capability may help us to rely on only one codebase. We do not need to separate HANA-only features in another codebase which has to be switched out on none HANA-Systems. Unfortunately the current version of the HANA-grid doesn’t give us the ability to influence the handling of the grid like a normal ALV-Grid does. We need the ability to take care of the grid’s internal table of data storage in none-HANA scenarios. Another solution could be a refresh function by the grid. By calling the grid’s refresh function a new SQL query is being sent with the defined filter and sort criteria to the database. Also we need the ability to define the truncation.

 

After solving this we are still not ready to use the HANA-grid due to the fact we are not able to manipulate the WHERE-clause. Well, I think in the meantime will be a solution of a master-detail-relationship based on HANA-features for sure. But this doesn’t help us in our case.

 

Due to our business scenario our solution has to be used by both, HANA and none-HANA customers.

 

As I described earlier we use code generation to avoid native-SQL. But the code generation doesn't help us in case of the HANA-Grid. Remember we do not have the ability to query the database by our own.

Summary

With our solution we are able to support the user by an explorative search technique. It’s a kind of generic solution which does not rely on further development once it is transported to the customer. Due to the fact the user never switches the system (for instance to jump into a BW system, do the analytics there and jump back to his operative application) he is able to build a check out of the combined filter criteria to integrate it into the already defined set of checks which are processed when a new invoice arrives.

 

This prototyping is not at the end. Some technical problems must be solved to build other features on top of this approach. But these problems are tough because they depend on needed extensions to OpenSQL (sub queries in dynamic WHERE clauses) or to the HANA-Grid.

 

The general availability of the HANA-Platform features not only a huge gain of speed but also on additional functionalities to operate on Big Data. But first we have to lift the customers to that platform. I suggest it is only done by building hybrid solutions which take care of the base business cases which run faster and give some view of benefits if run on HANA. To minimize the effort we have to rely on only one codeline which we have to support.

OO ABAP having problems retrieving value from screen dropBox field

$
0
0

Hi,

 

I am a new in ABAP, and need some advice.

I have a class and in its definition I  have class-data: dropBox (same name as in screen) field from the screen. When I create a instance of a class and fill with data dropBox. data is populated properly using F4IF_INT_TABLE_VALUE_REQUEST method. But I can not retrieve the selected value. In screen dropBox field 'conversion exit' is set to ALPHA.

Tried to do it without a class it works, and I can get data.

Question is, can I do it using a class the way I explaining at the beginning of discussion.

Am I missing something?

 

Thanks,

Aivaras

How To download ALV Report to .xls format when running in background?

$
0
0

Hi Expert,

 

 

1. Currently I have a requirement to read data by blocks, I mean if there are 5000 records, I need to process it by 1000? How can we do this in ABAP?

2. I already have an output in ALV Format but the 2nd requirement is to download in Excel while running in background,

     What is our approach regarding this?

 

Please Advice and thanks.

 

 

Regards,

Borland

Direct SAP table update issues

$
0
0

Hello Experts,

 

    Currently, in my customer system i see one custom program which is updating SAP standard table (SCM EWM) directly using below statement.

 

 

 

     "update /SAPAPO/MATLWH set rsqty = zmax_qty where matid = mat_wa_chunk-matid and scuguid = mat_wa_chunk-entitled_id."

 

 

 

      I see that program is there in production from last almost 2 years and that is a product quantity update program which has to run periodically.

 

    As per my knowledge, this is not at all acceptable. Can you please share me your thoughts, what kind of problems will occur and pre-defined

    errors with direct data base table update?

 

 

 

   What should we do now on this?

 

 

 

   Thank you in advance.

how to know the first week of the year is having particular day?

$
0
0

Hi,

 

 

Iam struggling to get a first week of the year. I have gone through some FMs related to date& year but i didn't get the clarity. Here is me requirement.

 

If first week of the year does not have tuesday, then tuesday date will be replaced by the first date of the year means 1st January.

 

someone please help me to get this...

 

Message was edited by: geetha swapna


RV60SBAT (VF06) - How to get into driver program in debugging

$
0
0

Hi,

 

I am using program RV60SBAT (VF06) to process invoices in background. I have a z-driver program and a z-form(script). Driver program contains the logic to send emails to intended recipients. When I am running program RV60SBAT in background as a batch job, the email is sent correctly but the subject and sender of the email is not correct as you can see the 2nd line with yellow traffic light in below pic.

 

SOST.png

 

When I use program RSNAST00 to process the invoice in background it goes with the correct information as shown in the above pic with green traffic light. I can get into debug mode when using RSNAST00 and check my driver program and make changes. Now I am using RSNAST00 for testing purpose and the client is going to use RV60SBAT (VF06) in background. I am unable to get into my driver program using RV60SBAT to see what's going wrong here. Please let me know if there is a way to debug this and for a possible solution.

 

Please note that I have set up the subject of the email as shown below and the sender logic is in the program.

Email Subject.PNG

 

Regards,

Rakesh

issue in For all Entries

$
0
0

Hi,

     I have an issue Regarding For all entries stament,

 

my statement is

 

SELECT   EBELN

                ebelp

               LOEKZ

               MATNR

               BUKRS

               WERKS

               MATKL netwr  from ekpo INTO TABLE tb_ekpo  FOR ALL ENTRIES IN tb_pack1 WHERE  loekz ne 'L'

               and matkl = tb_pack1-matkl.


but the statment is retrieving 0 entries into internal table  tb_ekpo , and tb_pack1 has 2 entries.


tb_pack1 entries are,


sno   text                                                      Matkl

2      REINFORCED CEMENT CONCRETE     115

 

2      REINFORCED CEMENT CONCRETE     100

 

I have checked  entries in ekpo table ,with same conditions , it shows forty entries.

where i might have been wrong,

 

please Help.

SO HEADER TEXT

$
0
0

Dear Gurus,

 

When I create a new SO, header text will default one customer's text, it also pop up the message: Test is formatted -> Details in VA01.

 

However in screen Text determination analysis, these texts that get default content have access sequence, but I can't search text in SO10. (for example: Object: KNVV, ID: C003)

 

In this case, I wanna know the default text how to link to SO HEADER?

 

Thanks in advance.

 

Jamie

Download data from internal table to excel sheet from the background

$
0
0

Hello Experts,

 

I have written a code where the data is stored in the internal table . Now when i run this code in the background i want this internal table data to get downloaded in the excel sheet. The function module GUI_DOWNLAOD is not supported in the background. So is there any other function module that can be used or is there any other way to do this

 

Thanks in advance

Getting associated values from F4 Help

$
0
0

Hi all,

i have already searched about it on SCN but not get any thread where i can resolve my problem so here i am posting it, i have created a screen in which i have provided F4 help, in this F4 help i am showing name and associated number of employeees, when ever user picks any values from F4 help i wants to capture the associated number from the screen, for this what i have done till now is.

I have created a F4 help and when user enters the values, i have used a PAI event to capture the corresponding values by using translation like shown below. Here ztable-rm_name is the screen field for which F4 help has been provided, and emp_code is the value i have to capture.

 

MODULE NUMBER INPUT.

 

IF ZTABLE-RM_NAME IS NOT INITIAL.

   IF IT_ZINCEN IS NOT INITIAL.

   SORT IT_ZINCEN BY RM_NAME.

 

   LOOP AT it_zincen INTO wa_zincen.

       TRANSLATE wa_zincen-RM_NAME TO UPPER CASE.

       wa_zincen1-rm_name = wa_zincen-rm_name.

       wa_zincen1-emp_code = wa_zincen-emp_code.

     APPEND wa_zincen1 TO it_zincen1.

   ENDLOOP.

 

 

   READ TABLE it_zincen1 INTO wa_zincen1 WITH KEY RM_NAME = ZSDPROJECT1-RM_NAME.

   IF SY-SUBRC = 0.

     EMP_CODE5 = WA_ZINCEN1-EMP_CODE.

   ENDIF.


As you can see that i am fetching the emp_code through it_zincen1 which i have already got through the database and it contains the list of all employees

and its associated numbers, the problem which i am getting is that , while fetching the data by passing rm_name it will provide the emp_code of first matching rm_name, so it will give an ambiguity in result , if there will be more than one employee in the database.


So, i am looking for any other approach, that will give consistent result , i have done it through DYNP_VALUES_READ also, but not getting proper result, please if someone has the idea about how to achieve it, please tell me the solution.

Thanks in advance.

F4 help not appearing for standard domain and data element.

$
0
0

Hi Experts,

    

I am using BLART and BSCHL standard fields in my custom Ztable .

 

However after creating and activating the table and while checking the selection screen I am seeing that the F4 hlep from these fields is not appearing.

 

Is this a technical issue I can resolve from my end or should some configuration be done?

 

On checking the value table of these corresponding for BLART and BSCHL, I am able to see the F4 help, but not when  I use the same in my Ztable its not appearing.

 

Please advise.

Extract Image in thrid-party System using Image Location

$
0
0

Hi All,

 

I am working in an Interface project. I need your help in one of the requirement.

 

The data will flow from third-party system as an XML file and we are using Webservice to extract the data.

 

The requirement is the third-party system will send the image location in the XML file and we need to extract the Image stored in the third-party system using that Image Location.

 

Is this feasible and if so how?

 

With Regards,

Gurulakshmi


Migrating data from crm system to ecc system

$
0
0


Hi Team,

I want to transfer data from cem system to ecc system,how i can achieve this?

What is best way to transfer data ? IDOC or BDOC?

Can't display values from memory

$
0
0

Hi, all experts

 

i am having trouble displaying the value that i have imported to memory.

 

EXPORT keyfgr           FROM  p_keyfgr     TO MEMORY ID 'CM_KEYFGR'.

EXPORT fcst_filedata    FROM gt_fcst_filedata[]       TO MEMORY ID 'CM_FCST_FILEDATA'.

SUBMIT (g_hlp_progname) WITH fpath  = p_fname
                           WITH vrsioz = p_vrsioz
                           VIA SELECTION-SCREEN
                           AND RETURN
                           .


When i want to use this value in my other tcode is doesn't display value. pls, help


IMPORT keyfgrTO D FROM MEMORY ID 'CM_KEYFGR'.

IMPORT fcst_filedata TO GTA_fcst_filedata FROM MEMORY ID 'CM_FCST_FILEDATA'.
     LOOP AT GTA_fcst_filedata INTO WA_fcst_filedata.
          WRITE: / WA_fcst_filedata-FIELD1.
    ENDLOOP.

signature problem in sapscript

$
0
0

When i am executing the driver program i am not getting the output means no signature is coming in invoice report

 

driverprogram code

 

*FORM get_signature TABLES in_tab TYPE zitcsy                      " added by kaustav das

*                          out_tab TYPE zitcsy.

*

* DATA: frggr like ekko-frggr,

*       frgsx like ekko-frgsx,

*       frgke like ekko-frgsx,

*       frgzu LIKE ekko-frgzu.

*

* DATA v_num like ekko-ebeln.

*

* DATA : v_num1 LIKE cdhdr-objectid,

*        v_num2 LIKE cdhdr-username,

*        v_num3 LIKE cdhdr-tcode.

*

*DATA : v_num4 LIKE v_usr_name-bname,

*       v_num5 LIKE v_usr_name-name_text.

*

*CLEAR : v_num.

*

** SELECT * FROM ekko WHERE ebeln = p_ebeln.

*

*READ TABLE in_tab WITH KEY name = 'ekko-ebeln'.

*

* IF sy-subrc eq 0.

*   v_num = in_tab-value.

* ENDIF.

*

* SELECT SINGLE username tcode FROM cdhdr INTO (v_num2,v_num3)

*                                 WHERE objectid = v_num.

*

*   IF sy-subrc eq 0.

*

*  SELECT SINGLE name_text FROM v_usr_name INTO v_num5

*                                 WHERE bname = v_num2.

*    ENDIF.

*

* LOOP AT out_tab.

*     IF out_tab-name = 'v_num2'.

*        out_tab-value = v_num2.

*     ELSEIF out_tab-name = 'v_num3'.

*        out_tab-value = v_num3.

*     ELSEIF out_tab-name = 'v_num5'.

*        out_tab-value = v_num5. .

*     ENDIF.

*     MODIFY out_tab TRANSPORTING value.

* ENDLOOP.

*

* endform.

 

SCRIPT LAYOUT

 

/* signature Preapred Added by kaustav das
/:DEFINE &V_NUM2& &V_NUM3& &V_NUM5&
/:PERFORM GET_SIGNATURE IN PROGRAM ZMMPURCHASEORDERDRIVER5
/:USING &EKKO-EBELN&
/:CHANGING &V_NUM2&
/:CHANGING &V_NUM3&
/:CHANGING &V_NUM5&
/:ENDPERFORM
/:IF &V_NUM3& EQ 'ME21N'
BS'Prepared By.'
BS  &V_NUM5&
/:BITMAP 'KAUSTAV_DAS' OBJECT GRAPHICS ID BMAP TYPE BMON DPI 100
/:ENDIF

 

 

But only prepared by line is print..Sign and name is not Showing

Proxies vs IDocs

$
0
0

Hi all,

 

how to decide between Proxies and IDocs when it comes to data transfer from one system to other?

 

What are the various factors on which the above decision depends?

 

Thanks in advance.

Sorted Table - tabix issue

$
0
0

All,

 

I have the following code While executing system is pointing to sy-tabix, but the data I am getting in the READ statement is from last record in the internal table

 

 

report  z_9699_30.
tables : eket.
types : begin of ty_eket.
        include structure eket.
types:  end of ty_eket.
data: wa_eket                 type ty_eket.
data: it_eket                 like sorted table of wa_eket
                              with unique key primary_key
                              components ebeln ebelp etenr
                              with non-unique sorted key secondary_key
                              components ebeln ebelp.
parameters: p_ebeln like eket-ebeln.
parameters: p_ebelp like eket-ebelp.
select * from eket into table it_eket
      where ebeln eq p_ebeln.
      read table it_eket into wa_eket with table key secondary_key
               components ebeln  = p_ebeln
                          ebelp  = p_ebelp.

 

 

Please copy and execute this by giving EBELN and EBELP from EKET

 

Please make sure while selecting from EKET please select data of multiple records available for same EBELP ie llike

 

Here below PO # 4500000003 and for Item # 00030 is have multiple records

 

Here in selection screen by giving PO # as 4500000003 (EBELN) Item # as 00030 (EBELP) , then in the above READ statement system giving SY-TABIX as 3 but if you see the WA_EKET-ETENR is showing 2 instead of 1. This is where is the issue is

 

 

 

 

EBELNEBELPETENRHeader 4
4500000003000101
4500000003000201
4500000003000301
4500000003000302
Viewing all 8332 articles
Browse latest View live


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