cancel
Showing results for 
Search instead for 
Did you mean: 

How pick date from bkpf table with out changing the print prog

Former Member
0 Kudos

Hi guys,

i want to display the date (bldat) from bkpf table in the form. im using standard prog J_1AF007 and the tcode is s_alr_87012222. i want to do this without changing the print program. for this we need to write routines. can any one tell me what values we need to pass and how can v get date from bkpf. can any one tell me how to do this.

thanks in advance.

Rahul

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Rahul,

I think u can use J_1AI02-BLDAT for printing it would solve the problem,if it doesnt give the right value,

use J_1AI02-BELNR and other values in the program given by George

instead of BKPF it would resolve the problem

Reward if useful.

Cheers,

Deepthee Kasal

Edited by: deepthee kasal on Jan 4, 2008 6:47 AM

glio_ad
Active Participant
0 Kudos

Hello.

Copy the sapscript form to a Z one.

In the window you want to print the data write the following:

/: PERFORM ZGET_BLDAT IN PROGRAM ZAF_ROUTINES

/: USING &BELNR&

/: USING &GJAHR&

/: USING &BUKRS&

/: CHANGING &BKPF-BLDAT&

/: ENDPERFORM

In SE38 create the program ZAF_ROUTINES as an executable and create just the form ZGET_BLDAT as follows:

FORM ZGET_BLDAT TABLES in_tab STRUCTURE itcsy

out_tab STRUCTURE itcsy.

tables: BKPF.

data: wl_belnr like bkpf-belnr,

wl_gjahr like bkpf-gjahr,

wl_bukrs like bkpf-bukrs.

read table in_tab index 1.

wl_belnr = in_tab-value.

read table in_tab index 2.

wl_gjahr = in_tab-value.

read table in_tab index 3.

wl_bukrs = in_tab-value.

select single * from bkpf

where belnr = wl_belnr

and gjahr = wl_gjahr

and bukrs = wl_bukrs.

out_tab-value = bkpf-bldat.

MODIFY out_tab INDEX 1 TRANSPORTING value.

ENDFORM.

I have assumed that you already have the document number, year and company code in the form as BELNR, GJAHR and BUKRS variables known to the form.

Reward points if helpful.

Regards,

George

Edited by: George Lioumis on Jan 3, 2008 5:12 PM

Former Member
0 Kudos

Hi,

thank you, this is ok. but if i don't have BELNR GJAHR BUKRS values in the form then how can pick the date from BKPF table.

Thanks,