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

Not able to get long text of outline agreement Line item-service (from READ_TEXT).

$
0
0

Hello Friends,

I am not able to get outline agreement long text data from READ_TEXT module. Here I can show my process.

 

  1. ME33K-->enter agreement no then press enter.

       

     3.

       

     4.go to header as per below preview.

        

 

Note :

 

     -> Below table EKPO for document no.

        

 

     Que1->why in table 13026 in header 13027 ?

     Que2->what is the combination for this successor number i.e. 0000000002 for different line items.

     Que3->Why I feel this is somewhat different form our routine practice of using READ_TEXT function module.

     Que4->why include text from smartform is not working properly with <FS>PACKNO variable.

 

-Avirat


Is there any exit for Substitution of FAGLFLEXA-PRCTR?

$
0
0

Is there any exit/ way i can substitute the PRCTR/Profit Center in GL view rather then substitute it at BSEG Level?

When a transaction is being posted and all New GL derivation rules fail to derive the correct profit center for the FAGLFLEXA Line item, The substitution should assign the profit center based on given criteria which includes combination of Company codes and their respective Default Profit Centers.

 

Is it actually possible to substitute a FAGLFLEXA Line item Field? Is yes, How do we do it in this scenario.

Determine class name used for calling a static method

$
0
0

Hi all,

 

I know static methods cannot be redefined, but they can be called using a subclass as the 'calling class name'. Is it possible to determine the object type used for calling a static method?

 

For example, I have ZCL_SUPER with a static method HELLO and a subclass ZCL_SUB.

 

I can use ZCL_SUPER=>HELLO( ) or I can use ZCL_SUB=>HELLO( ).

 

Both will execute the same code (correct), but is it possible to tell the difference inside the HELLO method? SY-REPID will always show the superclass (also correct).

 

I've found some similar threads but none with a clear answer.

 

Any input appreciated,

Mike

Multiple use BADI benefit

$
0
0

Hi GURUs,

 

Can you please tell me a scenario where multiple active implementation of a BADI is absolutely necessary? For example, we have a BADI ME_PURCHDOC_POSTED which is multiple-use. But why do we need this as multi-use, is there any functionality that we would have missed if it was a single implementation BADI?

 

Thanks,

Sariful

Replication of BDC issue in production server

$
0
0

HI All,

I am facing performance issue in production system.

In Quality and Dev, BDC runs fine.

I cant execute same data in production for measuring performance as same data will get created.

Can anybody kindly guide, how can i replicate the scenario in production?

 

 

Thanks,

SD

Problem in Billing in routine

$
0
0

Hello,

 

     i create routine for billing in VF04. in that when we create billing in VF04 and in that it will take a one condition type price then it finds its range and by this range it will count with percentage then it will give a final value. i want to move this final value to other condition type. so please tell me how can i do this?

For example two condition type PR00 and ZRCT. now when i create billing at that time system will take PR00 price then it finds its pricing range and it will count with given percentage and after i get a final price. now i want to move this final price in ZRCT condition type. so please tell me how can i solve this problem? any suggestion will help me to solve out this problem.

 

Thanks & Regards.

Adding New Tab in MIGO

$
0
0

HI all

 

 

i add new tab in MIGO screen the field is showing its fine.

 

once i fill the MIGO screen and click post means all the data are save successfully, custom field not save

 

 

file:///C:/Users/user/Downloads/Add%20Custom%20Tab%20in%20Detail%20screen%20for%20MIGO%20Transa..%20(1).pdf

 

 

i refer this document

 

i dont know what to write in IF_EX_MB_MIGO_BADI~POST_DOCUMENT (post document)

 

 

please help me this

 

 

Regards..,

Manikand Ems

How to display fields in list view in webdynpro configuration using Feeder Class

$
0
0

Hi experts,

I have to 7  fields in the table,these 7 fields to display in webdynpro using feeder class.

i have created one z class using  IF_FPM_GUIBB_LISTand implemented z method Get_employee.

then after i created configuration in webdynpro using feeder class,nothing to display in list.

please give me a solution.


Dump at FM

$
0
0

Hi,

I have created a report for pricing and used 3 functional modules in it.Everything works fine but when I try to execute the call function  'SPR_KOMK_KOMP_FILL', it throws a dump. I am not getting why it is going in dump.

I have attached some screenshots,please check.

Please help me out.

unable to create domain with"ztel" name

$
0
0

Hi,

Few days ago i tried to create new domin with name "ZTEL" but SAP did not allow me to create domain and was asking for ACCESS key.

I was trying to create new domin with 'Z' prefix  and also i have checked that if ZTEL is not already created or not . but it was not existing object.

Note : i am able to create Data element with "ZTEL" name

 

Though i changed domain name to "ZTELL" , due to lack of time and did not go deeper in problem at that time.

but now want to know reason behind this behavior.  I wonder why SAP is not allowing me to create domain with name "ZTEL".



Is it reserve for something ?

 

Thanks in adavance

Smartform printing # in place of space for some item description

$
0
0

Hi,

 

I need to replace # in the smartforms printing in place of space. On debugging what I see is that value does not have #, space is there. But when we go out to print smartform or print preview smartform, it is showing #. On debug I changed the values manually then it is printing fine.

 

I also used :

replace all occurrences of  cl_abap_char_utilities=>CR_LF in str with space. But no help.

 

Please advise.

 

Regards,

Devanshu

Exception CX_SY_NO_HANDLER triggered

$
0
0

while updating PA2013 infotype from CLASS through proxy. Iam getting Exception CX_SY_NO_HANDLER

 

METHOD ZZxxxxxxxxx~INFO2013.

data : ls_pa2013 type PA2013.

data: lt_data type standard type of ZINFO...

field-symbols <ls_data> type ZINFO...

 

lt_data[] = INPUT-INFO-records[].

 

loop at lt_data assigning <ls_data>.

call function 'BAPI_EMPLOYEE_ENQUEE'

exporting

number = <ls_data>-pernr

importing

return = return.

 

Call Function 'hr_infotype_operation'

exporting

infty = '2013'

number = <ls_data>-pernr

SUBTY = <ls_data>-subty

validityend = <ls_data>-endda

validitybegin = <ls_data>-begda

record = lt_data

operation = 'MOD'

importing

return = return.

 

clear ls_pa2013

call function 'BAPI_EMPLOYEE_DEQUEE'

EXPORTING

NUMBER = <ls_data>-pernr

importing

return = return.

endloop.

endmethod.

SMARTFORMS - Problem in grid maintenance

$
0
0

Capture.JPG

Dear all

I d'like to ask you a question.

 

As you can see i have a line of a grid with four columns here . Last colymn haw 4,80 cm witdtn and NO FIFTH COLUMN EXISTS!

 

Capture1.JPG

I am showing you the grid with four lines also....

 

When I run the corresponding program, at the time that I try to ask for a preview of the print a take the mesage below.

Capture3.JPG

"Line 1 column 5 do not exit"

Can you provide me please with a solution on this?

 

I realy can't find the real cause and I ' can't ( obviously ) print!

 

Thank you in advance  for you effort!

Show Data in Excel Format embedded in SAP directly - ABAP Report

$
0
0

Hi, Experts,

 

We have a Z report showing an ALV Grid. The client is needing to see the content in Excel format embedded in SAP directly.

 

We dont know how we can integrate our report with Excel to get the next result like a standard report,

 

The next is a standard report and we can see the funcionality that we are needing in our Z report

 

-> Select Options--> Options

lista.png

Office integration-> XLS

lista2.png

Excel directly from SAP

 

lista3.png

 

Thanks for your valuable feedback about the solution, maybe you have a ABAP code to generate de report with this excel format direclty

Determine class name used for calling a static method

$
0
0

Hi all,

 

I know static methods cannot be redefined, but they can be called using a subclass as the 'calling class name'. Is it possible to determine the object type used for calling a static method?

 

For example, I have ZCL_SUPER with a static method HELLO and a subclass ZCL_SUB.

 

I can use ZCL_SUPER=>HELLO( ) or I can use ZCL_SUB=>HELLO( ).

 

Both will execute the same code (correct), but is it possible to tell the difference inside the HELLO method? SY-REPID will always show the superclass (also correct).

 

I've found some similar threads but none with a clear answer.

 

Any input appreciated,

Mike


Integration with handheld scanners

$
0
0

Dear All,

 

Currently we are in the realization phase of one of our retail implementation. we have come across a requirement, where customer wants to receive the materials using handheld device.

 

i have got no  idea on how to integrate sap with handheld devices. can some one through a light on this....

 

options which are in my mind

 

1) Enabling WEBGUI, so that they can access the screens using browsers of handheld device.

2) Creating a new webdynpro application with required screens and creating the respective business document using service call...

 

can some one help me on this....i really got no clue on what needs to be done....

ABAP 7.40 Quick Reference

$
0
0

So you're an experienced ABAP programmer wanting to leverage off the fantastic new functionality available to you in ABAP 7.40!

 

However, searching for information on this topics leads you to fragmented pages or blogs that refer to only a couple of the new features available to you.

What you need is a quick reference guide which gives you the essentials you need and shows you how the code you are familiar with can be improved with ABAP 7.40.

 

The below document contains exactly this!

 

It gives examples of "classic" ABAP and its 740 equivalent. It goes into more details on the more difficult topics normally via examples. This allows the reader to dive in to the level they desire. While this document does not contain everything pertaining to ABAP 740 it certainly covers the most useful parts in the experience of the author.

 

The document has been compiled by drawing on existing material available online as well as trial and error by the author. In particular the blogs by Horst Keller have been useful and are the best reference I have found (prior to this document ). He has a landing page of sorts for his various blogs on the topic here:

ABAP Language News for Release 7.40

 

Credit also goes to Naimesh Patel for his useful explanations and examples on ABAP 7.40. Here is his example of the "FOR iteration expression" which I leaned on (links to his other 740 articles can be found at the bottom of the link):

http://zevolving.com/2015/05/abap-740-for-iteration-expression/

 

I compiled the below document to make the transition to using ABAP 740 easier for myself and my project team. It has worked well for us and I hope it will do the same for you.

 

Regards,

Jeff Towell

 

ABAP 7.40 Quick Reference  

 

 

Author:

      Jeffrey Towell

Date Created:

Friday, 22 May 2015

 
 

Contents

 

Inline Declarations

Table Expressions

Conversion Operator CONV

  1. Definition.
  2. Example.

Value Operator VALUE

  1. Definition.
  2. Example for structures.
  3. Examples for internal tables.

FOR operator

  1. Definition.
  2. Explanation.
  3. Example 1.
  4. Example 2.
  5. FOR with THEN and UNTIL|WHILE.

Reduce

  1. Definition.
  2. Note.
  3. Example 1.
  4. Example 2.
  5. Example 3.

Conditional operators COND and SWITCH

  1. Definition.
  2. Example for COND.
  3. Example for SWITCH.

Strings

  1. String Templates.
  2. Concatenation.
  3. Width/Alignment/Padding.
  4. Case.
  5. ALPHA conversion.
  6. Date conversion.

Classes/Methods

  1. Referencing fields within returned structures.
  2. Methods that return a type BOOLEAN..
  3. NEW operator

Meshes

  1. Problem..
  2. Solution.
  3. Output

Filter

  1. Definition.
  2. Problem..
  3. Solution.

 

Inline Declarations

Description

Before 7.40

With 7.40

Data statement

DATA text TYPE string.
text = `ABC`.

DATA(text)=`ABC`.

Loop at … into work area

DATA wa like LINE OF itab.
LOOP AT itab INTO wa.  
...
ENDLOOP.

LOOP AT itab INTO DATA(wa).  
  ...
ENDLOOP
.

Call method

DATA a1 TYPE ...

DATA a2 TYPE ...

oref->meth( IMPORTING p1 = a1

IMPORTING p2 = a2 )

oref->meth( IMPORTING p1 = DATA(a1)

IMPORTING p2 = DATA(a2)).

Loop at … assigning

FIELD-SYMBOLS: <line> type …

LOOP AT itab ASSIGNING <line>

  1. ENDLOOP.

LOOP AT itab ASSIGNING FIELD-SYMBOL(<line>).
...
ENDLOOP.

 

Read assigning

FIELD-SYMBOLS: <line> type …

READ TABLE itab ASSIGNING <line>.

READ TABLE itab ASSIGNING FIELD-SYMBOL(<line>).

Select * from

DATA lt_itab TYPE TABLE OF dbtab.

SELECT * FROM dbtab INTO TABLE lt_dbtab where field1 = lv_field1.

SELECT * FROM dbtab INTO TABLE @DATA(lt_dbtab) WHERE field1 = @lv_field1.

Select single f1 f2

 

SELECT SINGLE f1 f2 FROM dbtab

  INTO (lv_f1, lv_f2)

WHERE …

WRITE: / lv_f1, lv_f2.

SELECT SINGLE f1 AS my_f1,  "a ref for f1

              F2 AS abc     "a ref for f2

         FROM dbtab

         INTO @DATA(ls_str)  "structure

        WHERE …

WRITE: / ls_str-my_f1, ls_str-abc.

 

 
 

 

Table Expressions

If a table line is not found, the exception CX_SY_ITAB_LINE_NOT_FOUND is raised. No sy-subrc.

Description

Before 7.40

With 7.40

Read Table … index

READ TABLE itab INDEX idx

      INTO wa.

wa = itab[ idx ].

Read Table … using key

READ TABLE itab INDEX idx

     USING KEY key INTO wa.

wa = itab[ KEY key INDEX idx ].

Read Table … with key

READ TABLE itab

  WITH KEY col1 =

           col2 =

      INTO wa.

wa = itab[ col1 =  

           col2 = ].

Read Table … with key components

READ TABLE itab

      WITH TABLE KEY key

COMPONENTS col1 =

            col2 =

       INTO wa.

wa = itab[ KEY key col1 =

                   col2 = ].

Does record exist?

READ TABLE itab

    TRANSPORTING NO FIELDS.

IF sy-subrc = 0.

  ...

  1. ENDIF.

IF line_exists( itab[ ... ] ).

...

  1. ENDIF.

 

Get table index

DATA idx type sy-tabix.

READ TABLE TRANSPORTING NO FIELDS.

idx = sy-tabix.

DATA(idx)= line_index( itab[ ] ).

 

NB: There will be a short dump if you use an inline expression that references a non-existent record.

        SAP says you should therefore assign a field symbol and check sy-subrc.

 

ASSIGN lt_tab[ 1 ] to FIELD-SYMBOL(<ls_tab>).
IF sy-subrc = 0.
...

ENDIF.


NB: Use itab [ table_line = … ] for untyped tables.

 

Conversion Operator CONV

Definition

CONV dtype|#( ... )

dtype = Type you want to convert to (explicit)

#     = compiler must use the context to decide the type to convert to (implicit)


Example

Methodcl_abap_codepage=>convert_toexpects a string

Before 7.40

DATA text TYPE c LENGTH 255.

DATA helper TYPE string.

DATA xstr   TYPE xstring.

 

helper = text.

xstr = cl_abap_codepage=>convert_to( source = helper ).

With 7.40

DATA text TYPE c LENGTH 255.

 

DATA(xstr) = cl_abap_codepage=>convert_to( source =CONV string( text )).

OR

DATA(xstr) = cl_abap_codepage=>convert_to( source =CONV #( text )).

 

 

 

Value Operator VALUE

Definition

     Variables:    VALUE dtype|#( )

     Structures:  VALUE dtype|#( comp1 = a1 comp2 = a2 ... )

     Tables:         VALUE dtype|#( ( ... ) ( ... ) ... ) ...

 

Example for structures

     TYPES:  BEGIN OF ty_columns1,“Simple structure
                     cols1 TYPE i,
                     cols2 TYPE i,
                   END OF ty_columns1.

      TYPES: BEGIN OF ty_columnns2,  “Nested structure
                     coln1 TYPE i,
                     coln2 TYPE ty_columns1,
                  END OF ty_columns2.

      DATA: struc_simple TYPE ty_columns1,
                struc_nest    TYPE ty_columns2.

 

     struct_nest   = VALUE t_struct(coln1 = 1
                                                  coln2-cols1 = 1
                                                  coln2-cols2 = 2 ).


     OR


     struct_nest   = VALUE t_struct(coln1 = 1
                                                   coln2 = VALUE #( cols1 = 1

                                                   cols2 = 2 ) ).


Examples for internal tables

Elementary line type:

 

TYPES t_itab TYPE TABLE OF i WITH EMPTY KEY.

DATA itab TYPE t_itab.

itab = VALUE #( ( ) ( 1 ) ( 2 ) ).

 

Structured line type (RANGEStable):

 

DATA itab TYPE RANGE OF i.

itab = VALUE #( sign = 'I'  option = 'BT' ( low = 1  high = 10 )
( low = 21 high = 30 )
( low = 41 high = 50 )
option = 'GE' ( low = 61 )  ).

 

FOR operator

Definition

     FOR wa|<fs> IN itab [INDEX INTO idx] [cond]

 

Explanation

This effectively causes a loop at itab. For each loop the row read is assigned to a work area (wa) or field-symbol(<fs>). This wa or <fs> is local to the expression i.e. if declared in a subrourine the variable wa or <fs> is a local variable of that subroutine. Index like SY-TABIX in loop.

Given: 

TYPES: BEGIN OF ty_ship,
           tknum
TYPE tknum,     "Shipment Number
           name 
TYPE ernam,     "Name of Person who Created the Object
           city 
TYPE ort01,     "Starting city
           route
TYPE route,     "Shipment route
      
END OF ty_ship.
TYPES: ty_ships TYPE SORTED TABLE OF ty_ship WITH UNIQUE KEY tknum.
TYPES: ty_citys TYPE STANDARD TABLE OF ort01 WITH EMPTY KEY.

 

GT_SHIPStypety_ships. -> has been populated as follows:

RowTKNUM[C(10)]Name[C(12)]City[C(25)]Route[C(6)]
1001JohnMelbourneR0001
2002GavinSydneyR0003
3003LucyAdelaideR0001
4004ElainePerthR0003

 

 

 

Example 1

Populate internal table GT_CITYS with the cities from GT_SHIPS.

Before 7.40

  DATA: gt_citys TYPE ty_citys,
gs_ship 
TYPE ty_ship,
gs_city 
TYPE ort01.

LOOP AT gt_ships INTO gs_ship.
gs_city
gs_ship-city.
APPEND gs_city TO gt_citys.
ENDLOOP.

With 7.40

DATA(gt_citys) = VALUE ty_citys( FOR ls_ship IN gt_ships ( ls_ship-city ) ).

 

Example 2

Populate internal table GT_CITYS with the cities from GT_SHIPS where the route is R0001.


Before 7.40

  DATA: gt_citys TYPE ty_citys,
gs_ship 
TYPE ty_ship,
gs_city 
TYPE ort01.

LOOP AT gt_ships INTO gs_ship WHERE route = 'R0001'.
gs_city
gs_ship-city.
APPEND gs_city TO gt_citys.
ENDLOOP.

With 7.40

DATA(gt_citys) = VALUE ty_citys( FOR ls_ship IN gt_ships WHERE ( route = 'R0001' )

( ls_ship-city ) ).

Note: ls_ship does not appear to have been declared but it is declared implicitly.


FOR with THEN and UNTIL|WHILE

FOR i = ... [THEN expr] UNTIL|WHILE log_exp

Populate an internal table as follows:

TYPES:
  BEGIN OF ty_line,
    col1 TYPE i,
    col2 TYPE i,
    col3 TYPE i,
  END OF ty_line,
  ty_tab TYPE STANDARD TABLE OF ty_line WITH EMPTY KEY.

Before 7.40

DATA: gt_itab TYPE ty_tab,
j      
TYPE i.
FIELD-SYMBOLS <ls_tab> TYPE ty_line.

j
= 1.
DO.
j
= j + 10.
IF j > 40. EXIT. ENDIF.
APPEND INITIAL LINE TO gt_itab ASSIGNING <ls_tab>.
<ls_tab>
-col1 = j.
<ls_tab>
-col2 = j + 1.
<ls_tab>
-col3 = j + 2.
ENDDO.

With 7.40

DATA(gt_itab) = VALUE ty_tab( FOR j = 11 THEN j + 10 UNTIL j > 40
( col1 = j col2 = j + 1 col3 = j + ) ).

 
 

Reduce

Definition

... REDUCE type(

INIT result = start_value

           ...

FOR for_exp1

FOR for_exp2

...

NEXT ...

           result = iterated_value           

... )

 

Note

     While VALUE and NEW expressions can include FOR expressions, REDUCE must include at least one FOR expression. You can use all kinds      of FOR expressions in REDUCE:

  • with IN for iterating internal tables
  • with UNTIL or WHILE for conditional iterations

Example 1

Count lines of table that meet a condition (field F1 contains “XYZ”).

Before 7.40

DATA: lv_lines TYPE i.

LOOP AT gt_itab INTO ls_itab where F1 = ‘XYZ’.
lv_
lines= lv_lines + 1.
ENDLOOP.

With 7.40

DATA(lv_lines) = REDUCE i( INIT x = 0 FOR wa IN gt_itab

                    Where( F1 = ‘XYZ’ ) NEXT x = x + 1 ).

 

Example 2

Sum the values 1 to 10 stored in the column of a table defined as follows

DATA gt_itab TYPE STANDARD TABLE OF i WITH EMPTY KEY.
gt_itab
= VALUE #( FOR j = 1 WHILE j <= 10 ( j ) ).

Before 7.40

DATA: lv_line TYPE i,
lv_sum 
TYPE i.

 

LOOP AT gt_itab INTO lv_line.
lv_sum
= lv_sum + lv_line.
ENDLOOP.

With 7.40

DATA(lv_sum) = REDUCE i( INIT x = 0 FOR wa IN itab NEXT x = x + wa ).

Example 3

Using a class reference - works because “write” method returns reference to instance object

With 7.40

TYPES outref TYPE REF TO if_demo_output.

DATA(output) =
REDUCE outref( INIT out  = cl_demo_output=>new( )
text
= `Count up:`
FOR n = 1 UNTIL n > 11
NEXT out = out->write( text )
  text
= |{ n }| ).

output->display( ).

 

 

Conditional operators COND and SWITCH

Definition

... COND dtype|#( WHEN log_exp1 THEN result1
[ WHEN log_exp2 THEN result2 ]
...
[ ELSE resultn ] ) ...

 

... SWITCH dtype|#( operand
WHEN const1 THEN result1
[ WHEN const2 THEN result2 ]
...
[ ELSE resultn ] ) ...

 

Example for COND

DATA(time) =

  COND string(

    WHEN sy-timlo < '120000' THEN

      |{ sy-timlo TIME = ISO } AM|

    WHEN sy-timlo > '120000' THEN

      |{ CONV t( sy-timlo - 12 * 3600 )

TIME = ISO } PM|

    WHEN sy-timlo = '120000' THEN

      |High Noon|

    ELSE

      THROW cx_cant_be( ) ).

 

Example for SWITCH

DATA(text) =
NEW class(
)->meth(
SWITCH #( sy-langu
WHEN 'D' THEN `DE`
WHEN 'E' THEN `EN`
ELSE THROW cx_langu_not_supported( ) ) ).

 
 

 

Strings

String Templates

A string template is enclosed by two characters "|" and creates a character string.

Literal text consists of all characters that are not in braces {}. The braces can contain:

  • data objects,
  • calculation expressions,
  • constructor expressions,
  • table expressions,
  • predefined functions, or
  • functional methodsand method chainings

Before 7.40

DATA itab TYPE TABLE OF scarr.
SELECT * FROM scarr INTO TABLE itab.

DATA wa LIKE LINE OF itab.
READ TABLE itab WITH KEY carrid = 'LH' INTO wa.

DATA output TYPE string.
CONCATENATE 'Carrier:' wa-carrname INTO output SEPARATED BY space.

cl_demo_output=>display( output ).

With 7.40

  SELECT * FROM scarr INTO TABLE @DATA(lt_scarr).
cl_demo_output
=>display( |Carrier: { lt_scarr[ carrid = 'LH' ]-carrname }| ).

 

Concatenation

Before 7.40

DATA lv_output TYPE string.
CONCATENATE
'Hello' 'world' INTO lv_output SEPARATED BY space.

With 7.40

DATA(lv_out) = |Hello| & | | & |world|.

 

Width/Alignment/Padding

WRITE / |{ 'Left'     WIDTH = 20 ALIGN = LEFT   PAD = '0' }|.
WRITE / |{ 'Centre'   WIDTH = 20 ALIGN = CENTER PAD = '0' }|.
WRITE / |{ 'Right'    WIDTH = 20 ALIGN = RIGHT  PAD = '0' }|.

 

Case

WRITE / |{ 'Text' CASE = (cl_abap_format=>c_raw) }|.
WRITE / |{ 'Text' CASE = (cl_abap_format=>c_upper) }|.
WRITE / |{ 'Text' CASE = (cl_abap_format=>c_lower) }|.

 

ALPHA conversion

DATA(lv_vbeln) = '0000012345'.
WRITE / |{ lv_vbeln  ALPHA = OUT }|.     “or use ALPHA = IN to go in other direction

 

Date conversion

WRITE / |{ pa_date DATE = ISO }|.           “Date Format YYYY-MM-DD
WRITE / |{ pa_date DATE = User }|.          “As per user settings
WRITE / |{ pa_date DATE = Environment }|.   “Formatting setting of language environment

Classes/Methods

Referencing fields within returned structures

Before 7.40

DATA: ls_lfa1  TYPE lfa1,
lv_name1
TYPE lfa1-name1.

ls_lfa1 
= My_Class=>get_lfa1( ).
lv_name1
= ls_lfa1-name1.

With 7.40

DATA(lv_name1) = My_Class=>get_lfa1( )-name1.

 

Methods that return a type BOOLEAN

Before 7.40

IF My_Class=>return_boolean( ) = abap_true.

  1. ENDIF.

With 7.40

IF My_Class=>return_boolean( ).

  1. ENDIF.

NB: The type “BOOLEAN” is not a true Boolean but a char1 with allowed values X,- and <blank>. 

       Using type “FLAG” or “WDY_BOOLEAN” works just as well.

 

     

NEW operator

This operator can be used to instantiate an object.

Before 7.40

DATA: lo_delivs TYPE REF TO zcl_sd_delivs,

      lo_deliv  TYPE REF TO zcl_sd_deliv.

CREATE OBJECT lo_delivs.
CREATE OBJECT lo_deliv.

lo_deliv = lo_delivs->get_deliv( lv_vbeln ).

With 7.40

DATA(lo_deliv) = new zcl_sd_delivs( )->get_deliv( lv_vbeln ).

 

 

Meshes

Allows an association to be set up between related data groups.


Problem

Given the following 2 internal tables:

TYPES: BEGIN OF t_manager,
name  
TYPE char10,
salary
TYPE int4,
END OF t_manager,
tt_manager
TYPE SORTED TABLE OF t_manager WITH UNIQUE KEY name.

TYPES: BEGIN OF t_developer,
name   
TYPE char10,
salary 
TYPE int4,
manager
TYPE char10,   "Name of manager
END OF t_developer,
tt_developer
TYPE SORTED TABLE OF t_developer WITH UNIQUE KEY name.


Populated as follows:

RowName[C(10)]Salary[I(4)]
1Jason3000
2Thomas3200
Row
Name[C(10)]

Salary[I(4)Manager[C(10)]
1Bob2100Jason
2David2000Thomas
3Jack1000Thomas
4Jerry1000Jason
5John2100Thomas
6Tom2000Jason

Get the details of Jerry’s manager and all developers managed by Thomas.

 

     

Solution

With 7.40

TYPES: BEGIN OF MESH m_team,
managers  
TYPE tt_manager  ASSOCIATION my_employee TO developers

                                                            ON manager = name,
developers
TYPE tt_developer ASSOCIATION my_manager TO managers  

                                                            ON name = manager,
END OF MESH m_team.

DATA: ls_team TYPE m_team.
ls_team
-managers   = lt_manager.
ls_team
-developers = lt_developer.

"Get details of Jerry's manager

ASSIGN lt_developer[ name = 'Jerry' ] TO FIELD-SYMBOL(<ls_jerry>). "get line of dev table
DATA(ls_jmanager) =  ls_team-developers\my_manager[ jerry ].

WRITE: / |Jerry's manager: { ls_jmanager-name }|,30 |Salary: { ls_jmanager-salary }|.

"Get Thomas' developers
SKIP.
WRITE: / |Thomas' developers:|.

 

ASSIGN lt_manager[ name = 'Thomas' ] TO FIELD-SYMBOL(<ls_thomas>).  "get line of manager table
LOOP AT ls_team-managers\my_employee[ thomas ] ASSIGNING FIELD-SYMBOL(<ls_emp>).
WRITE: / |Employee name: { <ls_emp>-name }|.
ENDLOOP.

 

Output

     Jerry's manager: Jason          Salary: 3000

 

     Thomas' developers:

     Employee name: David

     Employee name: Jack

     Employee name: John

 

 

Filter

Filter the records in a table based on records in another table


Definition

... FILTER type( itab [EXCEPT] [IN ftab] [USING KEY keyname]
           WHERE c1 op f1 [AND c2 op f2 [...]] )

 

Problem

Filter an internal table of Flight Schedules (SPFLI) to only those flights based on a filter table that contains the fields Cityfrom and CityTo.

 

Solution

With 7.40

TYPES: BEGIN OF ty_filter,
cityfrom
TYPE spfli-cityfrom,
cityto  
TYPE spfli-cityto,
f3      
TYPE i,
END OF ty_filter,
ty_filter_tab
TYPE HASHED TABLE OF ty_filter WITH UNIQUE KEY cityfrom cityto.
DATA: lt_splfi TYPE STANDARD TABLE OF spfli.

SELECT * FROM spfli APPENDING TABLE lt_splfi.

DATA(lt_filter) = VALUE ty_filter_tab( f3 = 2

                                ( cityfrom = 'NEW YORK'  cityto  = 'SAN FRANCISCO' )
( cityfrom = 'FRANKFURT' cityto  = 'NEW YORK' )  ).

DATA(lt_myrecs) = FILTER #( lt_splfi IN lt_filter WHERE cityfrom = cityfrom 

AND cityto = cityto ).

“Output filtered records
LOOP AT lt_myrecs ASSIGNING FIELD-SYMBOL(<ls_rec>).
WRITE: / <ls_rec>-carrid,8 <ls_rec>-cityfrom,30 <ls_rec>-cityto,

45 <ls_rec>-deptime.
ENDLOOP.

 

Note: using the keyword “EXCEPT” (see definition above) would have returned the exact opposite records i.e all records EXCEPT for those those returned above.

Skeleton/Architecture of a Technical Design plays crucial role

$
0
0

     Architecture of a technical design plays a crucial role in any project development of a SDLC. Its long time now, Organisations have matured up in their In-House Software Teams rather going for a client support. And almost a number of companies have their own well built IT-Support team. Not only restricted to the Network related issues, but even to handle daily chores ERP Related business issues.

 

     In Order to satisfy

  • Emerging business needs,
  • Compatibility and adaptability issues with upgrades,
  • To catch with the bench mark status in technology,

     Organisations have to opt for the consulting companies for the Roll Out and phase development activities. The critical phase arrives with coordination at the time of Handover from the project team to the support team. The support team has to adopt the new development objects in continuation to the existing support they carry in day-to-day chores.

 

To overcome the ambiguity, and ensure smoother transition, following plays crucial importance.

 

  • Follow of unique and precise architecture for all the development.
  • Integration of the support team in all crucial phases of the development.
  • Separation of business logic from Database Fetch and GUI handling.
  • Ensure proper provisions for ease of modifications and enhancements for future needs.
  • Adopting dynamic code built where possible.
  • Provision of code (commented) for any general extensions that usually arrive in future. per say, addition of a button on the GUI/Report display.
  • Avoid obsolete and outdated platforms.

PR05 trip details, additional info button, fields.

$
0
0

hi experts,

 

In sap pr05 we have a provision to enter an employee number. press enter, all the trip details are shown. now select any trip and click display , the line items of trip are shown depicting the various type of costs incurred during trip such as breakfast lunch dinner airfare etc.

 

here in this screen we have the button called 'Infos', on clicking it a new pop up is displayed where you can enter business partners, document number ,reason etc. so i wanted to know where these values are found in the database. i clicked F1 and it shows me the structure name. I am not able to find the table for these fields. i have searched for these fields in most of PTRV_* tables but could find these fields. Can some one please advice where the fields can be found, Also if any bapi exists which can get me those fields.

 

Thanks.

 

Br,

shadab

dump while creating a Project in CJ20N

$
0
0

Hi Gurus,

will one of you throw some light on ,what could possibly went wrong ,and I am getting dump

while creating a project?

Viewing all 8332 articles
Browse latest View live


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