Application Development 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: 

please help me

laxman_sankhla3
Participant
0 Kudos

hi

i want to send mail automatic to user when below condition is satified.

Data: ZUONR1 LIKE BSEG-ZUONR.

data: 2days_out type sy-datum.

2days_out = sy-datum + 2.

data: lv_date type sy-datum.

data: lv_formatdate(10) type c.

data: var1(4) type c,

var2(2) type c,

var3(2) type c.

lv_date = 2days_out.

var1 = lv_date+(4).

var2 = lv_date+4(2).

var3 = lv_date+6(2).

concatenate var3 var2 var1 into lv_formatdate separated by '.'.

<b>select single zuonr from bseg into zuonr1

where bukrs = 'GSEG' and ZUONR = lv_formatdate.</b>

<b>zuonr is not date field its character field .</b>

thanks.

1 ACCEPTED SOLUTION

former_member378318
Contributor
0 Kudos

You do not need to reformat the date, it is already in the correct format. Change you code as follows:

Data: ZUONR1 LIKE BSEG-ZUONR.

data: 2days_out type sy-datum.

2days_out = sy-datum + 2.

data: lv_date type sy-datum.

lv_date = 2days_out.

select single zuonr from bseg into zuonr1

where bukrs = 'GSEG' and ZUONR = lv_date.

9 REPLIES 9

former_member378318
Contributor
0 Kudos

You do not need to reformat the date, it is already in the correct format. Change you code as follows:

Data: ZUONR1 LIKE BSEG-ZUONR.

data: 2days_out type sy-datum.

2days_out = sy-datum + 2.

data: lv_date type sy-datum.

lv_date = 2days_out.

select single zuonr from bseg into zuonr1

where bukrs = 'GSEG' and ZUONR = lv_date.

former_member378318
Contributor
0 Kudos

Oops ignore my last message, you are right ZUONR is char not date. Is the select not working or do you require details on how to send an email??

0 Kudos

hi

select not working and also i require details on how to send an email?? .

please help .

thanks.

0 Kudos

hi

i got data in select but now i want how to send mail to perticular user.

thanks.

0 Kudos

Well I don't see any problems with the select statement and it should work so long as you have an entry in BSEG where bukrs = 'GSEG' and zuonr = DD.MM.YYYY

Have you checked an entry exists with the data you see in debug?

What makes you suspect the select is not working?

0 Kudos

You can use methods of the class CLS_BCS to send an external email, see the following examples:

BCS_EXAMPLE_1

BCS_EXAMPLE_2

BCS_EXAMPLE_3

BCS_EXAMPLE_4

BCS_EXAMPLE_5

BCS_EXAMPLE_6

0 Kudos

thanks man .

problem is solved.

Former Member
0 Kudos

hi,

declare var1, var2, var3 as string variables n try

wit regards,

Suresh.A

Former Member
0 Kudos

Hi,

correct it var1 = lv_date+0(4).

regards,

ruchika

Reward if useful.........