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

Update Z-table from internal table.

$
0
0

Hi Experts,

 

I have requirement to update z-table from an internal table.But,If some entries from the internal table exist in z-table then those entries should not get inserted/modified/updated.

 

I found one solution but it creates performance issue(i think).....

Solution i found::-

 

Take all records from z-table.

Delete records from internal table which matches above fetched records.

Now,insert remaining records into z-table.

 

Taking all records from z-table may take huge time.....

 

What is another feasible solution????

 

 

Thanks & Regards,

Abdul


OBJECT ORIENTED CONCEPT in ABAP

$
0
0

ABAP OBJECT ORIENTED CONCEPTS

 


What is difference between a variable and Object?


Any Memory allocated for a type or Types is called as Variable.

Any Memory Allocated for a type of Types along with Behaviour is called as an Object.


Classes are the concepts used to define Objects.


CLASS is called as Complex data type in SAP used to Define Objects. Object Required a concept called data Hiding Techniques.

CLASSES ARE DATA TYPES Used to Define Exact Object Properties.

ABAP CLASSES CAN BE DEFINED WITH TWO BLOCKS.

 

1. Definition Block

 

CLASS <NAME> DEFINITION.

   PUBLIC SECTION.

                DATA UNDER THIS AREA IS GLOBAL FOR EVERY BODY.

  PROTECTED SECTION.

              DATA UNDER THIS AREA CAN BE ACCESSED BY SAME CLASS MEMBERS OR OTHER RELATED CLASSES.

  PRIVATE SECTION.

       THIS DATA CAN BE ACCESSED BY ONLY CLASS MEMBERS.

ENDCLASS.


Under each Area ABAPer can define attributes using Data Statement.

METHODS is another statement can be used to define a functionality for class objects.

Using this definition Block ABAPer can define Only method definitions.

 

2. Implementation Block.


Is the block used to write Method Body using Following Syntax.

 

CLASS <NAME> IMPLEMENTAION.

       METHOD <NAME>.

                ABAP STATEMENTS.

       ENDMETHD.

ENDCLASS.

 

EXAMPLE CODE.


CLASS ABC DEFINITION.

  PUBLIC SECTION.

     METHODS FIRST.

ENDCLASS.

CLASS ABC IMPLEMENTATION.

  METHOD FIRST.

         WRITE : 'WELCOME TO ABAP WITH OBJECT ORINTED CONCEPTS'.

  ENDMETHOD.

ENDCLASS.

 

Object Decleration IN ABAP


DATA <OBJ> TYPE REF TO <CLASS_NAME>.

Objects in SAP Must be refered to the classes.

DATA : OBJ TYPE REF TO ABC.

 

When ever Object is defined in SAP there is no memory is allocated for Objects.

 

Create Object is the statement used in ABAP to Allocate memory for Objects in SAP.

 

Note: This statement can't be used directly in ABAP editor. This must be used under one Event.


START-OF-SELECTION " is the event executed in reports in between GUI and LPS invocation.

 

If There is no GUI, this evet is executed Before Loading Ouput

 

START-OF-SELECTION.

CREATE OBJECT OBJ.

 

If Object Memory is allocated then ABAPer can access the Methods using "CALL METHOD" statement.

     "->" is the Access Specified for the Methods and Attributes of an Object.

 

CALL METHOD OBJ->FIRST.

 

Existing Classes are created using a tcode called as "SE24" ( Class Builder ).

Classes defined In a program can be accessed by the Same program it Self. Where as the classes defined using SE24 can be accessed by any program , without using any program name.


Navigations to create a class using "SE24".

 

SE24 -> Name the class ( ZCLA2013 ) -> Click on Create -> Opens an interface -> Select the radiobutton as "class" ( default selected ) -> Click on Continue -> Enter Short Description for class ( any ) -> Click on Save -> Save the object under package -> Name the method ( PRINTDATA ) -> set Level as "Instance Method" -> Set the visibility  as Public ( default private ) -> If we need to pass any arguments for method click on "parametes" pushbutton -> set the type as "Importing" -> Set Associated type as "C" -> Come back to Methods -> Click on Pushbutton "Code" -> to Open Implementation coding area ->Generate the code as Follows ->

 

method PRINTDATA .

  write str.

endmethod.


-> save -> come back -> Activate the class

* Example code invoke class FROM SE38.

DATA  OBJ1 TYPE REF TO ZCLA2013.

PARAMETERS S1(20) .

START-OF-SELECTION.

CREATE OBJECT OBJ1.

CALL METHOD OBJ1->PRINTDATA

   EXPORTING

        STR =  s1.

 


Can we cancel a spool request?

$
0
0

Hi Experts,

After the spool request is created in SAP, is there any way to stop it from printing. Deleting it from SP01 will do the job, or something else need to be done. I want to create spool request, but don't want to print it immediately.Please reply.

 

Regards,

Anubhab

Unable to do external debugging for the badi implementation PT_ABS_REQ ?

$
0
0

Hi,

 

One year ago We had implemented a badi PT_ABS_REQ to validate the leaves applying from ESS Portal . We had tested in the development server the external debugging from ESS Portal is working is fine. But in production server the badi logic is working fine. But unable to do external debugging from the portal for all debugging enabled users. But the same user is able to do external debugging for any other WDA applications.

 

When I cross checked the badi from development to Production server I found a difference In productin server Badi's I found one difference in History as shown below i.e. IN ADJUSTEMENT MODE Status done by DDIC. I hope it was done after Support pack installation.

 

So Could you please any body help me why the latest status came like this and any help on External debugging from the ESS Portal?

 

 

 

 

 

     PT_ABS_REQ.png

 

 

 

 

Regards,

Praveen Chitturi.

can anyone provide the XSLT transformation for this.

$
0
0

I can successfully transfer XML data to internal table using CALL TRANSFORMATION, if all XML tag repeats all the time in XML file, but if all XML tag doesn't repeat then how to transfer data in internal table using CALL TRANSFORMATION.

 

<?sap.transform simple?>

<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">

  <tt:root name="ITAB"/>

  <tt:template>

    <SUGGESTION_LIST xmlns="urn:bobjsap_urac">

      <tt:loop name="a" ref=".ITAB">

        <ENTRY>

           <SELECTION>

            <tt:value ref="$a.SELECTION"/>

          </SELECTION>

          <LOCALITY1>

            <tt:value ref="$a.LOCALITY1"/>

          </LOCALITY1>

          <REGION1>

            <tt:value ref="$a.REGION1"/>

          </REGION1>

          <POSTCODE>

            <tt:value ref="$a.POSTCODE"/>

          </POSTCODE>

          <PRIMARY_NUMBER_LOW>

            <tt:value ref="$a.PRIMARY_NUMBER_LOW"/>

          </PRIMARY_NUMBER_LOW>

          <PRIMARY_NUMBER_HIGH>

            <tt:value ref="$a.PRIMARY_NUMBER_HIGH"/>

          </PRIMARY_NUMBER_HIGH>

          <PRIMARY_NAME1>

            <tt:value ref="$a.PRIMARY_NAME1"/>

          </PRIMARY_NAME1>

          <PRIMARY_TYPE1>

            <tt:value ref="$a.PRIMARY_TYPE1"/>

          </PRIMARY_TYPE1>

          <PRIMARY_POSTFIX1>

            <tt:value ref="$a.PRIMARY_POSTFIX1"/>

          </PRIMARY_POSTFIX1>

          <POSTCODE2_ODD>

            <tt:value ref="$a.POSTCODE2_ODD"/>

          </POSTCODE2_ODD>

          <POSTCODE2_EVEN>

            <tt:value ref="$a.POSTCODE2_EVEN"/>

          </POSTCODE2_EVEN>

          <PRIMARY_SIDE_INDICATOR>

            <tt:value ref="$a.PRIMARY_SIDE_INDICATOR"/>

          </PRIMARY_SIDE_INDICATOR>

          <UNIT_DESCRIPTION>

            <tt:value ref="$a.UNIT_DESCRIPTION"/>

          </UNIT_DESCRIPTION>

          <UNIT_NUMBER_LOW>

            <tt:value ref="$a.UNIT_NUMBER_LOW"/>

          </UNIT_NUMBER_LOW>

          <UNIT_NUMBER_HIGH>

            <tt:value ref="$a.UNIT_NUMBER_HIGH"/>

          </UNIT_NUMBER_HIGH>

          <SECONDARY_SIDE_INDICATOR>

            <tt:value ref="$a.SECONDARY_SIDE_INDICATOR"/>

          </SECONDARY_SIDE_INDICATOR>

        </ENTRY>

      </tt:loop>

    </SUGGESTION_LIST>

  </tt:template>

</tt:transform>

 

 

 

<suggestion_list>
<![CDATA[
  <SUGGESTION_LIST xmlns=
"urn:bobjsap_urac">
   <ENTRY>
    <SELECTION>1</SELECTION>
    <LOCALITY1>ARLINGTON HEIGHTS</LOCALITY1>
    <REGION1>IL</REGION1>
    <POSTCODE>60005</POSTCODE>
    <PRIMARY_NUMBER_LOW>1210</PRIMARY_NUMBER_LOW>
    <PRIMARY_NUMBER_HIGH>1210</PRIMARY_NUMBER_HIGH>
    <PRIMARY_NAME1>S SURREY RIDGE</PRIMARY_NAME1>
    <PRIMARY_TYPE1>DR</PRIMARY_TYPE1>
    <PRIMARY_POSTFIX1>N</PRIMARY_POSTFIX1>
    <POSTCODE2_ODD>8912</POSTCODE2_ODD>
    <POSTCODE2_EVEN>8912</POSTCODE2_EVEN>
    <PRIMARY_SIDE_INDICATOR>E</PRIMARY_SIDE_INDICATOR>
   </ENTRY>

   <ENTRY>
    <SELECTION>1</SELECTION>
    <LOCALITY1>ARLINGTON HEIGHTS</LOCALITY1>
    <REGION1>IL</REGION1>
    <POSTCODE>60005</POSTCODE>
    <PRIMARY_NUMBER_LOW>1210</PRIMARY_NUMBER_LOW>
    <PRIMARY_NUMBER_HIGH>1210</PRIMARY_NUMBER_HIGH>
    <PRIMARY_NAME1>S SURREY RIDGE</PRIMARY_NAME1>
    <PRIMARY_TYPE1>DR</PRIMARY_TYPE1>
    <PRIMARY_POSTFIX1>N</PRIMARY_POSTFIX1>
    <POSTCODE2_ODD>8912</POSTCODE2_ODD>
    <POSTCODE2_EVEN>8912</POSTCODE2_EVEN>
    <PRIMARY_SIDE_INDICATOR>E</PRIMARY_SIDE_INDICATOR>
   </ENTRY>

   <ENTRY>
    <SELECTION>1</SELECTION>
    <LOCALITY1>ARLINGTON HEIGHTS</LOCALITY1>
    <REGION1>IL</REGION1>
    <POSTCODE>60005</POSTCODE>
    <PRIMARY_NUMBER_LOW>1210</PRIMARY_NUMBER_LOW>
    <PRIMARY_NUMBER_HIGH>1210</PRIMARY_NUMBER_HIGH>
    <PRIMARY_NAME1>S SURREY RIDGE</PRIMARY_NAME1>
    <PRIMARY_TYPE1>DR</PRIMARY_TYPE1>
    <PRIMARY_POSTFIX1>N</PRIMARY_POSTFIX1>
    <POSTCODE2_ODD>8912</POSTCODE2_ODD>
    <POSTCODE2_EVEN>8912</POSTCODE2_EVEN>
    <PRIMARY_SIDE_INDICATOR>E</PRIMARY_SIDE_INDICATOR>
   </ENTRY>

  </SUGGESTION_LIST>]]>
</suggestion_list>


SAP query - why would the query title be linked to a selection screen text label?

$
0
0

Hi:

 

When I tried to change the query title, one of the selection screen text label changed also; and when the selection screen label is changed, the query title changed.  They seem to be linked, so they display the same texts.  How do I remove the link between them?

 

title.JPG

 

selection_field.JPG

Custom F4 Help not getting displayed

$
0
0

Hello Experts,

I have the following code for  dispalying the F4 help for user.

i have this paramater on screen which should have only 3 values

AM, EC and a ' ' (i.e a blank).

 

 

  AT SELECTION-SCREEN on VALUE-REQUEST FOR groups.

  CLEAR LIST[].
  list-val  = 'AM'.
  APPEND LIST.
  CLEAR LIST.
  LIST-val  = 'EC'.
  APPEND LIST.
  CLEAR LIST.
LIST-val  = ''.
APPEND LIST.

CLEAR LIST.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
  EXPORTING
    retfield              = 'VAL'
    dynpprog              = sy-repid
    dynpnr                = sy-dynnr
    dynprofield            = 'GROUPS'
    VALUE_ORG              = 'S'
  tables
    value_tab              = LIST

    RETURN_TAB              = IT_RETURN[]

  EXCEPTIONS
    PARAMETER_ERROR        = 1
    NO_VALUES_FOUND        = 2
    OTHERS                = 3
          .

But when i run it i dont have any thing in the screen

this is what i get when i click on the button.

What could be done to fix this issue.

 

Abhijeet

 

 

Displaying XML in SAP in dynpro. No pop up. How?

$
0
0

Hi,

 

I found this link and can you it to display an XML string in a pop up window.

https://scn.sap.com/thread/758646

 

I dont want the result to be in a pup op window. I want it to be in a dynpro (no separate pop up). How can I achieve it?

 

Thanks


module pool- fill all entries

$
0
0

Hi..

  I've developed a module pool screen in which the fields are mandatory and 2 pushbuttons CLEAR and EXIT.

  I've defined EXIT as MODULE EXIT AT EXIT-COMMAND and so as CLEAR.

BUT CLEAR is not working. it is showing error message 'fill in all entries'. i'm are not using any gui status only the screen attributes in which function type is defined as E.

   Please help........

Usage of same internal table for two functions

$
0
0

Hello Experts,

 

 

I have a requirement like this. I have to send an alv report as excel attachment through mail.

 

 

So basically I have two values in list box......(Overview and Detail). If overview is selected one report is generated and if detail is selected another report is generated.

 

I am declaring these internal tables for excel creation and sending it as email.

 

IT_DOCDATA TYPE STANDARD TABLE OF SODOCCHGI1,
IT_PACKLIST TYPE STANDARD TABLE OF SOPCKLSTI1,
IT_ATTACHMENT TYPE STANDARD TABLE OF SOLISTI1,
IT_BODY_MSG TYPE STANDARD TABLE OF SOLISTI1,
IT_RECEIVERS TYPE STANDARD TABLE OF SOMLRECI1.

 

So my question is can I use the same internal tables and work area for Overview report as well as Detail report. Some times the user will view the overview report and will come to back to see the Detail report. In that case do i have to refresh these internal tables and work areas?

 

Regards,

 

Marina.

 

 


Read PDF files with Open DataSet(to avoid error corrupted file)

$
0
0

I solved this error today, was looking in the web for this solution and could not find, I just found a lot of people with the same issue, after upload the PDF and try to open in the server or attached the file or sending the file we got an error saying that the file has a error and could not be fixed, the reason is the file size, the open dataset is getting the sy-subrc <> to 0 at the last record and the record is not getting into the table. At the moment to exit we have to append the last row in the table.

 

I hope this help anyone.

 

TYPES: BEGIN OF hex_record,

        field(1024)  TYPE x,

       END OF hex_record.

 

lt_tab_ex2       TYPE STANDARD TABLE OF hex_record WITH HEADER LINE,

 

OPEN DATASET lv_fname FOR INPUT IN BINARY MODE.

      IF SY-subrc EQ 0.

        DO.

          READ DATASET lv_fname INTO lt_tab_ex2-field.

          IF SY-subrc EQ 0.

            append lt_tab_ex2.

          ELSE.

            append lt_tab_ex2.

            EXIT.

          ENDIF.

        ENDDO.

        CLOSE DATASET lv_fname.

Clear List after display using REUSE_ALV_GRID_DISPLAY

$
0
0

Hello All,

My report program generates three separate lists, the lists are not linked with each other.

I have displayed the output of a report in ALV LIST display.

I have 3 buttons on the PF-STATUS each corresponding to a separate list - for example - Employee File, Error File, Structure File.

The lists are displayed fine, the buttons allow me to toggle between lists. The only issue is when you press the BACK button, all the lists previously displayed are also retained, so you have to press BACK button several times.

How can I delete the previous list when a new button is selection from PF-STATUS such that when you press BACK, the program takes you to selection screen?

 

Thanks!

Add field of Cost Center for ME21N in Item Overview

$
0
0

Hello All,

 

I need to add the cost center field for ME21N in item overview section.

Can anyone please help mi out to solve this problem.

 

Where should i do necessary changes (enhancement or badi) to solve this?

 

I am New to SAP-ABAP.

 

Thank you.

Adobeform for multiple trays

$
0
0

Adobeform for multiple trays

We have some printers with multiple trays. Depending on the message category, we can print adobeform from a specific tray. Rule will be always as simple i.e. for one message category; we know the tray number where we want to print the adobeform.

 

First we need, maintain data in TVARVC as below:

 

Go to Transaction STVARV and maintain the data for the Message Category and Tray Value.

 

1.jpg

 

Name contains the Message Category and the Value is Tray Name / Number (i.e. either for Duplex Printer or Simplex Printer)

 

Before calling the function module ‘FP_JOB_OPEN’, pass the value of the tray name or number in the field ‘JOB_PROFILE’ of the structure ‘SFPOUTPUTPARAMS’ i.e. form processing output parameter.

 

Code as below:

Taking example for Production Order (CO01/02/03)

 

Transaction OPK8

List Name

 

3.jpg

 

Driver Program: PSFC_OBJECT_LIST_PDF

Enhancement Spot at Form ‘FILL_OUTPUTPARAMS’.

 

2.jpg

DATA:        lv_messageo TYPE fpjobprofile,

                  lv_msgo     TYPE rvari_vnam.

 

CONSTANTS: lc_msg1 TYPE rvari_vnam VALUE 'ZFPP01_',

                     lc_msg2 TYPE rvari_vnam VALUE 'ZFPP02_'.

 

*-- Concatenate like 'ZFPP01_LG01ZP01'

*-- print_co-lstid contains value of list name i.e. LG01 and print_co-auart contains the value of Order Type i.e. ‘ZP01’, ‘ZP03’, etc.

CONCATENATE lc_msg1 print_co-lstid print_co-auart INTO lv_msgo.

 

*-- Select query to fetch the tray value from table 'TVARVC' comparing the Message Category

 

SELECT SINGLE low  "ABAP/4: Selection value (LOW)

INTO lv_messageo

FROM tvarvc "Table of Variant Variables (Client

WHERE name = lv_msgo

      AND type = lc_value_p.

IF sy-subrc EQ 0.

    xs_outputparams-job_profile = lv_messageo. " Populate the value of the Tray name in the field 'JOB_PROFILE'.

ENDIF.

 

This is how depending on the message category, print will come from a specific tray in the printer has multiple trays.

 

Thanks for reading the document.

 

Regards,

Debopriya Ghosh

 

How to use method GETLIST of cl_message_handler_mm.

$
0
0

Hello experts,

I want to use this method but I don't know how can I use this, let me show you my code:

 

DATA l_msg_handler    TYPE REF TO cl_message_handler_mm.

 

CALL METHOD l_msg_handler->GETLIST

   EXPORTING

     IM_EVENT_TYPE            =

     IM_OBJECT                =

     IM_NULL_OBJECT_VALID     = MMPUR_NO

     IM_INCLUDE_CHILD_OBJECTS = mmpur_no

     IM_SEQUENCE              = ''

   IMPORTING

     EX_EVENTS                =

     EX_EVNT                  =

    

Wich are the parameters that I need send?  and Hoe can I use this method? I don't know what parameters and type parameters that I need to send and recive.

Please your help


selfield-fieldname is not populated in ALV

$
0
0

Hi Expert,

 

selfield-fieldname  is not populated in ALV grid. i used no colhead in layout  gwa_layout-no_colhead = 'X' . For first two field in ALV selfield-fieldname is coming for other it is not coming . please provide your valuabalee input.

 

 

Thanks

An error has occurred: Could not create an object of type 'CrystalReports.ObjectFactory'.

$
0
0

Hello Everyone!

 

 

I need help with Business Object Crystal Report Server, after restoring the server for some tech reason , the report is keep throwing this error:

 

 

Error

 

Back

 

An error has occurred:

 

Could not create an object of type 'CrystalReports.ObjectFactory'.

 

 

Please let me know if you are aware of the issue and if you think you can fix that.

 

We are running reports on IIS 6 on Windows 2003 r2.

 

Thanks,

Input parameter is not save after selection. Please help!

$
0
0

Hi all,

 

I am writing a report that read two inputs parameters. These are obligatory.

 

SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE text-005.

PARAMETERS:   name(40) type c OBLIGATORY.

PARAMETERS:   nr type i OBLIGATORY.

SELECTION-SCREEN END OF BLOCK 1.

 

AT SELECTION-SCREEN ON VALUE-REQUEST FOR name.

............

 

Perfom XXXX.

Perform YYY.

 

What am I doing wrong?

 

I can select the first parameter from the help list without problem. When I enter the second one, I can see that the variable is empty after setting a break point and going in the debug mode.

 

What should I do to make this work? Please help.

ABAP runtime errors COMPUTE_BCD_OVERFLOW

$
0
0

Hi All,

 

I am getting the below dump:

 

>> Short dump has not been completely stored. It is too big.


Overflow for arithmetical operation (type P) in program "SAPLCSS7 "

 

"COMPUTE_BCD_OVERFLOW"

"BCD_FIELD_OVERFLOW" (By release 4.0A, this error has been remedied at this

point)

"SAPLCSS7 " or "LCSS7FS1 "

"STUFE_02"

 

Information on where termination occurred

 

The termination occurred in the ABAP/4 program "SAPLCSS7 " in

"STUFE_02".

The main program was "Z_S1_DOCS ".

The termination occurred in line 242

of the source code of program "LCSS7FS1 " (when calling the editor 2420).

 

Source code extract

FORM STUFE_01.
   AST_STUFE = 0.
ENDFORM.


FORM STUFE_02.
----->  APS_STUFE = AST_STUFE + 1 .
ENDFORM.


FORM STUFE_03.
   CHECK NOT LTB-XTLNR IS INITIAL.

   AST_STUFE = LTB-STUFE.
ENDFORM.

 

How to solve this problem. Please help.

 

Thanks,

Venkata

how to remove two zeros after seven 5,456,200,700.00

$
0
0

Hi Experts,

 

The value is 5,456,200,700.00 but i need to display as the value 5,456,200,7.00.

Kindly help me how to remove the zeros after seven. Even though i have used packed data type like data: Gv type p decimals 2.

 

Thank you.

 

Regards

Suni

Viewing all 8332 articles
Browse latest View live


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