Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV report

Former Member
0 Likes
610

Im unable to write the logic for my requirement wil u please provide me the procedure according to my requirement n any other Transactions already existed

My reqirement is as follows,

STEP 1. Screen Field Validations:

o Validate Customer Number (KUNNR) from KNA1.

o Validate Company Code (BUKRS) from t001.

STEP 2. Data Retrieval and Calculations.

1) Get Accounting Document Number(BELNR), Posting Date (BUDAT), Document Date(BLDAT),Current(WAERS), Debit/Credit Indicator(SHKZG), Amount in Local currency(DMBTR), Amount in Foreign Currency (WRBTR) from BSID table matching the Customer (KUNNR), Company Code (BUKRS), Special G/L Indicator (UMSKZ) as entered in the selection screen.

2) Get Months 1(MON01, MON02, MON03, and MON04) Percentage details for Reserve Bad Debt (PROZ1, PROZ2, PROZ3 and PROZ4) From T030F matching the Provision method (RSMET) in the selection screen.

3) Get Name1 (NAME1), Name 2 (NAME2), City (ORT01), Postal Code (PSTLZ), Street (STRAS) From KNA1 matching the Customer Account in the selection screen.

4) Fetch Guaranteed amount (YYDEFGTYVAL) from KNB1 by using Customer Account and Company Code from selection screen.

5) The report will print Company code Description, Company Code value, Title, Time, Date, User ID and Page Number at top of the list.

6) Rule 1 mentioned above is applied to find the sign or Debit/Credit indicator and corresponding value is displayed on the report.

7) Sort items retrieved from BSID by due date. Due date will calculated as sum of BSID-ZFBDT and BSID-ZDB1T.

8) Number of days in arrear is calculated by difference between key date from selection screen and due date calculated in the step above. (Rule 2)

9) Calculate the provision by the logic mentioned below:

If T030F-PROZ1 = 100.

• Sum up all the BSID-DMBTR for a combination of Company Code (BUKRS) and Customer (KUNNR) to get the total receivables of that particular combination.

• IF KNB1-YYDEFGTYVAL (guaranteed amount) > total receivables.

Do not calculate any provision

ELSE.

Rate = (Total receivables – guaranteed amount) / total receivables.

Individual Provision = BSID-DMBTR * RATE

ELSE.

IF T030F-PROZ1 NE 100.

• The starting date of each group is calculated by deducting from the key date the number of months found below.

• Read T030F-MON01 and determine the number of months. Group1 is prepared by grouping invoices falling between start date of group1 and group 2.

• Read T030F-MON02 and determine the number of months. Group 2 is prepared by grouping invoices falling between start date of group2 and group3. If MON02 is empty then invoices are grouped in first group.

• Read T030F-MON03 and determine the number of months. Group 3 is prepared by grouping invoices falling between start date of group2 and group3. If MON03 is empty then invoices are grouped in second group.

• Read T030F-MON04 and determine the number of months. Group 4 is prepared by grouping invoices falling between start date of group3 and group4. If MON04 is empty then invoices are grouped in third group.

• First group invoices will be multiplied with T030F-PROZ1 and the percentage calculation is derived by dividing it with 100.

• Similarly second group invoices (Document Numbers) will be multiplied with T030F-PROZ2 and the percentage calculation is derived by dividing it with 100.

• T030F-PROZ3 is used for the percentage calculation of Group 3 document numbers.

• Fourth group Document numbers are used against T030F-PROZ4 and thus the percentage calculation is completed.

{BSID-DMBTR * corresponding T030F-PROZ (n)} / 100

Where n is group can have values from 1 to 4.

• Sum up all individual Provisions to give total temporary provisions.

• Sum total amount in local currency (BISD-DMBTR) of these open receivables to get total receivables for a combination of Company Code (BUKRS) & Customer (KUNNR).

• IF KNB1-YYDEFGTYVAL (guaranteed amount) > total temporary provisions.

Do not calculate any provision

ELSE.

Rate = (Total temporary provision – guaranteed amount) / total provisions

Individual Provision = BSID-DMBTR * RATE.

10) Display Report in ALV Format.

Tanx,

Sanyu.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
549

Hi,

First of all you have to define internal tables to get all the data wich can be passed for ALV output.

Try in se38 ALV loads of demo report are there.

Once you define the intarnal tables then in U need to mention selection options which will be co cd & customer in u r case.

Then AT SELECTION SCREEN.

Validate all u r input params

START-OF-SELECTION.

Retrieve your data & Display in ALV metho.

Cheers.

Hi,

First of all you have to define internal tables to get all the data wich can be passed for ALV output.

Try in se38 ALV loads of demo report are there.

Once you define the intarnal tables then in U need to mention selection options which will be co cd & customer in u r case.

Then AT SELECTION SCREEN.

Validate all u r input params

START-OF-SELECTION.

Retrieve your data & Display in ALV metho.

Cheers.

2 REPLIES 2
Read only

Former Member
0 Likes
550

Hi,

First of all you have to define internal tables to get all the data wich can be passed for ALV output.

Try in se38 ALV loads of demo report are there.

Once you define the intarnal tables then in U need to mention selection options which will be co cd & customer in u r case.

Then AT SELECTION SCREEN.

Validate all u r input params

START-OF-SELECTION.

Retrieve your data & Display in ALV metho.

Cheers.

Read only

0 Likes
549

Hi sunanda,

M unable to understand my requirement from dis step please go thru dis n please tell me the if statements logic for given below,

IF T030F-PROZ1 NE 100.

• The starting date of each group is calculated by deducting from the key date the number of months found below.

• Read T030F-MON01 and determine the number of months. Group1 is prepared by grouping invoices falling between start date of group1 and group 2.

• Read T030F-MON02 and determine the number of months. Group 2 is prepared by grouping invoices falling between start date of group2 and group3. If MON02 is empty then invoices are grouped in first group.

• Read T030F-MON03 and determine the number of months. Group 3 is prepared by grouping invoices falling between start date of group2 and group3. If MON03 is empty then invoices are grouped in second group.

• Read T030F-MON04 and determine the number of months. Group 4 is prepared by grouping invoices falling between start date of group3 and group4. If MON04 is empty then invoices are grouped in third group.

• First group invoices will be multiplied with T030F-PROZ1 and the percentage calculation is derived by dividing it with 100.

• Similarly second group invoices (Document Numbers) will be multiplied with T030F-PROZ2 and the percentage calculation is derived by dividing it with 100.

• T030F-PROZ3 is used for the percentage calculation of Group 3 document numbers.

• Fourth group Document numbers are used against T030F-PROZ4 and thus the percentage calculation is completed.

{BSID-DMBTR * corresponding T030F-PROZ (n)} / 100

Where n is group can have values from 1 to 4.

• Sum up all individual Provisions to give total temporary provisions.

• Sum total amount in local currency (BISD-DMBTR) of these open receivables to get total receivables for a combination of Company Code (BUKRS) & Customer (KUNNR).

• IF KNB1-YYDEFGTYVAL (guaranteed amount) > total temporary provisions.

Do not calculate any provision

ELSE.

Rate = (Total temporary provision – guaranteed amount) / total provisions

Individual Provision = BSID-DMBTR * RATE

Tanx,

santu.