SAP KD

Archives

Archive for April, 2009

April 30, 2009 @ 1:41 pm

Select for all entries

When you need to access many records from one internal table is better to use select for all entries.

instead of doing this

loop at internal-table

select * from table where…….

endloop.

it’s better to

SELECT * FROM bkpf INTO CORRESPONDING FIELDS OF TABLE it_bkpf

FOR ALL ENTRIES IN it_vbrk

WHERE bukrs = it_vbrk-bukrs

AND blart = ‘DV’

AND xblnr = it_vbrk-doc

AND bstat = ”.

This way you will have one select to all the entries in it_vbrk.

 

VN:F [1.9.3_1094]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.3_1094]
Rating: +1 (from 1 vote)

Filed under BC - ABAP · 1 Comment »

April 28, 2009 @ 10:11 am

Add SAP External Database Connection (DBCO)

When you want to set up external database connection, you need to use DBCO Transaction.

When using DBCO you are setting up the properties for an external database.

REPORT ztest.

DATA: BEGIN OF wa,
ncust(40) TYPE c,
name(35) TYPE c,
END OF wa.

DATA: dbs TYPE dbcon-con_name.
DATA: con(20) TYPE c.
DATA : ls_wa LIKE wa.

con = ‘TREMS’. “DB Connection you made in DBCO

EXEC SQL.
connect to :con

ENDEXEC.

EXEC SQL.
GET CONNECTION :con
ENDEXEC.

WRITE : con.

EXEC SQL PERFORMING loop_write.
select ncust, name from cust into :ls_wa
ENDEXEC.

*
**&———————————————————————*
**& Form LOOP_OUTPUT
**&———————————————————————*
** text
**———————————————————————-*
FORM loop_output.
WRITE: / ls_wa-ncust,
ls_wa-name.
ENDFORM. “LOOP_WRITE ENDLOOP.

VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Filed under BC - ABAP · No Comments »

April 23, 2009 @ 11:15 am

Button in Sales Order ( Generic Object Services )

The Upload files button in ECC is missing from sales order.

In order to place this button again in sales order, please do the following:

Go to SU01;
Insert Username and press Edit.;
Go to parameters and set: SD_SWU_ACTIVE = X ;

That’s it, go to sales order and the button will be there!!

VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Filed under SD, Tips · No Comments »

April 21, 2009 @ 1:58 pm

Difference between select single and up to 1 row

The ‘SELECT SINGLE’ statement selects the first row in the database that it finds that fulfils the ‘WHERE’ clause If this results in multiple records then only the first one will be returned and therefore may not be unique.

The ‘SELECT ….*….. UP TO 1 ROWS’ statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause or lack of, applies any aggregate, ordering or grouping functions to them and then returns the first record of the resultant result set.

Samples:


  Select single Posnr 
    from vbrp
    into w_POSNR. 

  Select Posnr 
    into table t_internal
    from VBRK
   up to 1 rows 
   order by Posnr descending.

VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Filed under BC - ABAP · No Comments »

April 17, 2009 @ 5:46 pm

Calculate number of days, months and years in SAP ABAP

In ABAP there is a function to calculate the number of days, months and years!

Example:

CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
  EXPORTING
    I_DATE_FROM = '20081008'

    I_DATE_TO   = '20090116'
  IMPORTING
    E_DAYS      = T_DAYS
    E_MONTHS    = T_MONTHS
    E_YEARS     = T_YEARS.
 
Result :  T_DAYS   = 466
          T_MONTHS = 16
          T_YEARS  = 2
VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Filed under BC - ABAP · No Comments »

April 17, 2009 @ 5:24 pm

How to block an input field selection screen

Just use this code:

PARAMETERS: p_werks LIKE mseg-werks OBLIGATORY DEFAULT ‘PHAS’ MODIF ID bl2.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = ‘P_WERKS’ .
screen-input = ‘0′.
screen-output = ‘1′.
MODIFY SCREEN.
ENDIF.
ENDLOOP.

VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Filed under BC - ABAP · No Comments »

April 2, 2009 @ 2:08 pm

Upload Images to SAP SAPSCRIPT

When you net to upload images to use in sapscript or smartforms you need to use report RSTXLDMC. this report will upload images as a standard text. Then call the text name as if you were calling an SO10 standard text:

VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Filed under BC - ABAP, Tips · No Comments »

April 1, 2009 @ 5:23 pm

Sales Documents Number Ranges

To see all sales documents number ranges in SAP, use transaction VN01.

VN:F [1.9.3_1094]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Filed under SD, Tips · No Comments »

About

The absolute best damn Wordpress Gallery on the net. ArenaWP is the sandbox for various designs by Terry Ng of Kineda.
Read More

Social

Subscribe by email:

Delivered by FeedBurner

Pages

  • Loading...


    Loading...

    Login






    Register | Lost password?



    Register





    A password will be mailed to you.
    Log in | Lost password?

    Retrieve password





    A confirmation mail will be sent to your e-mail address.
    Log in | Register
  • Calendar

    April 2009
    M T W T F S S
    « Mar   May »
     12345
    6789101112
    13141516171819
    20212223242526
    27282930  

    Sap Websites

    Recent Posts

    Categories

    Disclaimer

    SAP and the SAP logo are registered trademarks of SAP AG. SAPKD.com is a personal blog and is not affiliated with SAP or other companies mentioned here. I capture the things I learn that might be helpful to others here. No warranties on the information provided are offered or implied. Please feel free to use at your own risk