Welcome To My BLOG

This site is to give a brief idea for the abap learners who are looking for some real time programs .It consists of collection of programs from my side . I hope these programs are very much used for all of the learners. Please check the links for any information in ABAP.
Please vote for my Blog. And please input me on this mail addrssess.Email me

Share this link with your friends

http://www.rebtel.com/u/15163104576

For every friend who signs up using this link and makes a payment, we'll give you 8 €!


Wednesday, September 22, 2010

Direct database update

Description: The following code can be used as a template to produce an ABAP which updates a particular database
table field.
*&---------------------------------------------------------------------*
*& Report ZUPDATE_PRPS *
*& *
*&---------------------------------------------------------------------*
*& *
*& Quick report to Update PRPS-FAKKZ database field *
*&---------------------------------------------------------------------*
Report ZUPDATE_PRPS.
tables: prps.
parameter: p_wbs like prps-pspnr,
p_value like prps-fakkz default 'X'.
data: wa_fakkz type prps-fakkz.
************************************************************************
*START-OF_SELECTION
start-of-selection.
call function 'CONVERSION_EXIT_ABPSP_INPUT'
exporting
input = p_wbs
importing
output = p_wbs
exceptions
not_found = 1
others = 2.
select single fakkz
into wa_fakkz
from prps
where pspnr eq p_wbs.
if sy-subrc eq 0.
update prps set fakkz = p_value where PSPNR eq p_wbs.
if p_value is initial.
message i999(za) with 'Billing element field has been unchecked'.
else.
message i999(za) with 'Billing element field has been checked'.
endif.
else.
message i999(za) with 'WBS element not found'.
endif.

No comments: