cancel
Showing results for 
Search instead for 
Did you mean: 

Form not returning value

former_member586438
Participant
0 Kudos

Hi

I want the ccustomer's email address to also appear on document

The email value is not appearing on the ouput

I searched the forum for examples but can't fin my error

Can someone please assist me?

I'm using the following:

/:PERFORM FIND_MAIL IN PROGRAM Z000MAIL

/:USING &REGUH-LIFNR&

/:USING &REGUH-ZBUKR&

/:CHANGING &MAIL&

/:ENDPERFORM

/ &MAIL&

-


PROGRAM Z000MAIL.

FORM FIND_MAIL TABLES IN_TAB STRUCTURE ITCSY

OUT_TAB STRUCTURE ITCSY.

TABLES: LFB1.

DATA: LIFNR LIKE LFB1-LIFNR, "Account

BUKRS LIKE LFB1-BUKRS. "Company

  • CLEAR: IN_TAB,

  • OUT_TAB.

READ TABLE IN_TAB INDEX 1.

MOVE IN_TAB-VALUE TO LIFNR. "Account

READ TABLE IN_TAB INDEX 2.

MOVE IN_TAB-VALUE TO BUKRS. "Company

SELECT SINGLE * FROM LFB1 WHERE LIFNR EQ LIFNR

AND BUKRS EQ BUKRS.

READ TABLE OUT_TAB INDEX 1.

MOVE LFB1-INTAD TO OUT_TAB-VALUE.

MODIFY OUT_TAB INDEX 1.

  • CLEAR OUT_TAB.

ENDFORM.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

The Sapscript returns a value in the output form, so you need to convert it in the input form; I mean you make sure a certain variable has or doesn't have a convertion routine,

In your case LIFNR has the convertion routine ALPHA, so before using it you need to convert LIFNR by that routine:

READ TABLE IN_TAB INDEX 1.
  MOVE IN_TAB-VALUE TO LIFNR. "Account
  READ TABLE IN_TAB INDEX 2.
  MOVE IN_TAB-VALUE TO BUKRS. "Company

  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      INPUT  = LIFNR
    IMPORTING
      OUTPUT = LIFNR.

  SELECT SINGLE * FROM LFB1 WHERE LIFNR EQ LIFNR
                              AND BUKRS EQ BUKRS.

max

former_member586438
Participant
0 Kudos

Max

You are brilliant!

It worked

Many thanks

Gerhard

Answers (1)

Answers (1)

Former Member
0 Kudos

SELECT SINGLE * FROM LFB1 WHERE LIFNR EQ LIFNR

AND BUKRS EQ BUKRS.

What happens here? What's the return code? Is LFB1-INTAD populated? You probably should be getting from ADR6, using LFA1-ADRNR or perhaps the address or person number from the contact persons table, based upon the partner code for the person you're trying to email....