Wednesday, November 18, 2009

Connect BSIS and BSEG

For each billing Document created in the system, following tables will have the data. Following select statement showing how to connect the BSIS and BSEG .

 

IF  L_RELOAD_DATA = 'X'.

   SELECT BUKRS HKONT ZUONR gjahr BELNR BUZEI bschl wrbtr dmbtr SHKZG FROM BSIS INTO TABLE IT_BSIS

        WHERE BUKRS = <FIELD4> AND

              HKONT in r_HKONT AND

              ZUONR = KOMP-VGBEL.

   SORT IT_BSIS .

* Now Read the data from the BSEG using the above Accounting Docs and Item/Posting key

if not it_bsis[] is initial.

  select bukrs belnr buzei  bschl zuonr  vbel2 posn2  hkont dmbtr into table it_bseg

        from bseg for all entries in it_bsis

       where bukrs = it_bsis-bukrs and

             belnr = it_bsis-belnr and

             gjahr = it_bsis-gjahr and

             BUZEI = it_bsis-BUZEI.

  endif.



Billing user exit RV61AFZB Pricing Change

RV61AFZB

 

1. Before changing the Condition values The program will enter into       FORM USEREXIT_XKOMV_BEWERTEN_INIT. Of  RV61AFZB.

2. After this it will go to the pricing routines to perform the additional calculations for the condition and after that at the end of the process it will go to      FORM USEREXIT_XKOMV_BEWERTEN_END. Each time ,only one item conditions will be available in this  procedure.

Price change in Sales Order- KONV

If the price PR00 is changed manually in the Sales Order then the condition record will have KSTEU with ‘C’ and KMPRS as ‘X’ in KONV table.

The same is available during the MV45AFZZ save_document_prepare in the sales order user exit.

Following is table KONV showing the PR00 is changed manually.

Get the KNUMV from VBAK and enter into KONV to get the pricing conditions.

Table:

KONV

Displayed

fields:

5

of

5

Fixed

columns

KNUMV

KPOSN

KSCHL

KSTEU

KMPRS

 

 

 

 

 

0001814092

000010

PR00

C

X

0001814092

000010

MWST

A

 

0001814092

000010

SKTO

A

 

0001814092

000010

VPRS

A

 





Monday, November 16, 2009

Mutiple Parameters /radio buttons on the same Line

 

Sample Code:

 

SELECTION-SCREENBEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECTION-SCREENBEGIN OF LINE.
PARAMETERS      : p_rb1    RADIOBUTTON GROUP p2
                      USER-COMMAND dtl “ if you wanted to control

                      MODIF ID dtl.

SELECTION-SCREEN COMMENT 4(10text-rb1.”RB1 Text
PARAMETERS      : p_rb2    RADIOBUTTON GROUP p2 MODIF ID sum.
SELECTION-SCREEN COMMENT 18(12text-rb2."RB2 Text
SELECTION-SCREEN:   END OF LINE.

SELECTION-SCREENEND OF BLOCK b1.

 

Any change in the radio buttons can be validated as follows:

 

AT SELECTION-SCREEN OUTPUT.

  IF p_rb1 IS NOT INITIAL AND p_onli IS NOT INITIAL AND  p_vari IS INITIAL.

“ p_onli and p_vari are some variables that needs validation

    SET CURSOR FIELD 'P_VARI'.
    MESSAGE s999(zz) WITH  'Please Enter Layout Variant '.

   ENDIF.


Mutiple Parameters /radio buttons on the same Line

Sample Code:

 

SELECTION-SCREENBEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECTION-
SCREENBEGIN OF LINE.
PARAMETERS      : p_rb1    RADIOBUTTON GROUP p2
                      USER-COMMAND dtl “ if you wanted to control

                      MODIF ID dtl.

SELECTION-
SCREEN COMMENT 4(10text-rb1.”RB1 Text
PARAMETERS      : p_rb2    RADIOBUTTON GROUP p2 MODIF ID sum.
SELECTION-
SCREEN COMMENT 18(12text-rb2."RB2 Text
SELECTION-
SCREEN:   END OF LINE.

SELECTION-
SCREENEND OF BLOCK b1.

 

Any change in the radio buttons can be validated as follows:

 

AT SELECTION-SCREEN OUTPUT.

  
IF p_rb1 IS NOT INITIAL AND p_onli IS NOT INITIAL AND  p_vari IS INITIAL.

“ p_onli and p_vari are some variables that needs validation

    
SET CURSOR FIELD 'P_VARI'.
    
MESSAGE s999(zz) WITH  'Please Enter Layout Variant '.

   ENDIF.



Thanks & Regards

Durga  Prasad

OBBH Substitution FI

OBBH- FI Substitution Rules Transaction code
User exit for Substitution ZGGBS000


When u add a routine in the OBBH you need to define that in the user exit as below:
Definition:





FORM Code:















Extract the List of holidays between the 2 dates for the given factory/Holiday calendar:
REPORT zdp_holiday .
tables: tbkfk.
SELECT-OPTIONS:p_date FOR sy-datum.
DATA: lt_holidays type standard table of iscal_day.
parameters: p_facid like tbkfk-facid default 'NZ'.

CALL FUNCTION 'HOLIDAY_GET'
EXPORTING
HOLIDAY_CALENDAR = p_facid
* factory_calendar = p_facid
date_from = p_date-low
date_to = p_date-high
TABLES
holidays = lt_holidays
EXCEPTIONS
OTHERS = 5.

*---> Factory calendar Tcode: SCAL