Skip to Content
author's profile photo Former Member
Former Member

Parameters required for FM SO_DOCUMENT_SENDER_API1 while FAX

Hi All,

What should be the parameters which needs to be passed when using the FM 'SO_DOCUMENT_SENDER_API1' while sending the FAX. If possible please send in the Sample Code.

I have used the following program, but not sure what is missing as this is not sending FAX. Sy-subrc = 0. for the function call.

REPORT ZTEST_FAX10.

TABLES: MARA.

DATA : TAB_LINES TYPE I.

data: itab like standard table of mara with header line.

DATA: DOCDATA LIKE SODOCCHGI1,

OBJPACK LIKE SOPCKLSTI1 OCCURS 1 WITH HEADER LINE,

OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE,

OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE,

OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE,

OBJHEX LIKE SOLIX OCCURS 10 WITH HEADER LINE,

RECLIST LIKE SOMLRECI1 OCCURS 1 WITH HEADER LINE.

DATA: EXPORTDATA LIKE SOFOLENTI1-OBJECT_ID.

CLASS CL_ABAP_CHAR_UTILITIES DEFINITION LOAD.

CONSTANTS:

CON_TAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,

CON_CRET TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF,

CON_NWLN TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>NEWLINE.

SELECT-OPTIONS: P_MATNR FOR MARA-MATNR.

select * from mara into table itab where matnr in p_matnr.

*---CREATE MESSAGE : DOCDATA -


  • Name

DOCDATA-OBJ_NAME = 'TEST_FAX'.

  • Subject

DOCDATA-OBJ_DESCR = 'FAX TESTING'.

DESCRIBE TABLE itab LINES TAB_LINES.

LOOP AT itab.

CONCATENATE itab-matnr itab-ernam itab-mtart

INTO OBJBIN.

CONDENSE OBJBIN.

CONCATENATE CON_CRET OBJBIN INTO OBJBIN.

APPEND OBJBIN.

CLEAR OBJBIN.

ENDLOOP.

OBJPACK-HEAD_START = 1.

OBJPACK-HEAD_NUM = 0.

OBJPACK-BODY_START = 1.

OBJPACK-BODY_NUM = TAB_LINES.

OBJPACK-DOC_TYPE = 'OTF'.

APPEND OBJPACK.

RECLIST-COM_TYPE = 'TELFAX'.

RECLIST-FAX = '01514732277'.

RECLIST-REC_TYPE = 'F'.

RECLIST-COUNTRY = 'GB'.

APPEND RECLIST.

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

DOCUMENT_DATA = DOCDATA

  • PUT_IN_OUTBOX = ' '

COMMIT_WORK = 'X'

IMPORTING

  • SENT_TO_ALL =

NEW_OBJECT_ID = EXPORTDATA

TABLES

PACKING_LIST = OBJPACK

  • OBJECT_HEADER =

CONTENTS_BIN = OBJBIN

  • CONTENTS_TXT =

  • CONTENTS_HEX =

  • OBJECT_PARA =

  • OBJECT_PARB =

RECEIVERS = RECLIST

EXCEPTIONS

TOO_MANY_RECEIVERS = 1

DOCUMENT_NOT_SENT = 2

DOCUMENT_TYPE_NOT_EXIST = 3

OPERATION_NO_AUTHORIZATION = 4

PARAMETER_ERROR = 5

X_ERROR = 6

ENQUEUE_ERROR = 7

OTHERS = 8

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ELSE.

WRITE: / ' FAX TESTING ', SY-SUBRC .

ENDIF.

Can you please help me to find out the problem.

Regards,

Vidya.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 25, 2008 at 07:53 AM

    Hi

    Pls ref

    &----


    *& Report ZMMGL_PR_NOTPO

    *&

    &----


    *& Application : MM *

    *& Copied From Program Version : NA *

    *& Original Program : NA *

    &----


    & Functional : MANESH (MM Functional Consultant)

    *& Developer : MUTHUKUMAR *

    *& Created On : 17-12-2007 *

    *& Title : List of PRs Not yet converted to POs *

    *& Report Name : ZMMGL_PR_NOTPO *

    *& Transport Request : *

    & Related Information : List of released PR's Not yet convertd

    • to Pos - Plant Wise *

    *& : As on Date sy-datum *

    *&

    &----


    REPORT ZMMGL_PR_NOTPO.

    TABLES : EBAN. "Purchase Rquisition

    • Purchase Requistion Structure

    TYPES: BEGIN OF LS_PURREQ ,

    BANFN TYPE BANFN, "Pur.Req.No

    BNFPO TYPE BNFPO, "Pur.Req.Item no.

    MENGE type BAMNG, "PR Quantity

    MEINS TYPE BAMEI, "UOM

    BSART TYPE BSART, "Purchase Requisition Document Type

    BSTYP TYPE BSTYP, "Purchasing Document Category

    EKGRP TYPE EKGRP, "Purchasing Group

    WERKS TYPE WERKS, "Plant

    END OF LS_PURREQ.

    DATA : gs_purreq TYPE LS_PURREQ.

    TYPES : BEGIN OF ls_PLANT,

    WERKS TYPE WERKS, "Plant

    END OF ls_PLANT.

    DATA : wa_PLANT TYPE ls_PLANT,

    lt_PLANT TYPE STANDARD TABLE OF ls_PLANT.

    DATA: BEGIN OF TEXT,

    LINE TYPE SOLISTI1-LINE,

    END OF TEXT.

    DATA: WA_TEXT LIKE TABLE OF TEXT,

    LS_Mailrec TYPE STANDARD TABLE OF somlrec90,

    mailrec LIKE LINE OF LS_Mailrec,

    Text_sub TYPE STANDARD TABLE OF sodocchgi1,

    Textsub like LINE OF text_sub,

    wa_PURREQ TYPE LS_PURREQ,

    LV_PURREQ TYPE STANDARD TABLE OF LS_PURREQ,

    "LV_PURREQ_Tmp TYPE STANDARD TABLE OF LS_PURREQ,

    lc_pattern TYPE char30,

    lt_roles TYPE TABLE OF /virsa/zccrole.

    DATA: BEGIN OF ls_Getrole,

    • ALERTID TYPE CHAR6,

    • COUNTRY TYPE LAND1_GP,

    • IDNO TYPE INT1,

    ROLE TYPE CHAR30,

    END OF ls_Getrole.

    DATA: lt_Getrole like TABLE OF ls_Getrole.

    *DATA: BEGIN OF ls_Getuser,

    • AGR_NAME TYPE AGR_NAME,

    • USERID TYPE SYUNAME,

    • USERNAME TYPE AD_NAMTEXT,

    • END OF ls_Getuser.

    DATA : ls_Getuser TYPE /VIRSA/ZCCAEROLEU,

    lt_Getuser type STANDARD TABLE OF /VIRSA/ZCCAEROLEU.

    DATA : iv_PRQTY(15) TYPE c,

    iv_totalqty(15) TYPE c,

    iv_totalqtyC(15) type C,

    lv_alertid TYPE AGR_NAME,

    lv_country TYPE LAND1.

    *DATA : TV_PURREQ TYPE STANDARD TABLE OF LS_PURREQ with HEADER LINE .

    "PURCHASE REQUISTION

    • S E L E C T I O N S C R E E N *

    ************************************************************************

    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

    SELECT-OPTIONS:

    SO_BANFN FOR EBAN-BANFN,

    SO_BADAT FOR EBAN-BADAT,

    SO_WERKS FOR EBAN-WERKS,

    SO_EKGRP FOR EBAN-EKGRP.

    SELECTION-SCREEN END OF BLOCK b1.

    INITIALIZATION.

    START-OF-SELECTION.

    PERFORM FETCH_DATA.

    end-of-SELECTION.

    "PERFORM Get_Total.

    PERFORM Send_data.

    &----


    *& Form FETCH_DATA

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM FETCH_DATA .

    CLEAR LV_PURREQ.

    SELECT BANFN BNFPO MENGE MEINS

    BSART BSTYP EKGRP WERKS

    into TABLE LV_PURREQ

    from EBAN WHERE BANFN IN SO_BANFN

    AND WERKS IN SO_WERKS

    AND EKGRP IN SO_EKGRP

    AND BADAT IN SO_BADAT

    AND FRGKZ eq '2'

    AND EBELN eq ''.

    SORT LV_PURREQ by BANFN BNFPO EKGRP.

    LOOP AT LV_PURREQ INTO wa_PURREQ. "Plant only

    wa_PLANT-WERKS = wa_PURREQ-WERKS.

    collect wa_PLANT into lt_PLANT.

    ENDLOOP.

    *lt_purgrp[] = LV_PURREQ[].

    ENDFORM. " FETCH_DATA

    &----


    *& Form display_data

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM Send_data .

    if LV_PURREQ[] is NOT INITIAL.

    APPEND text-200 TO WA_TEXT. " <html> <STYLE type="text/css">

    APPEND text-201 TO WA_TEXT. "</STYLE></head ><body><p>

    APPEND text-202 TO WA_TEXT. "</STYLE></head ><body><p>

    APPEND text-216 TO WA_TEXT.

    APPEND text-203 TO WA_TEXT. "<BR>

    APPEND text-217 TO WA_TEXT.

    APPEND text-203 TO WA_TEXT. "<BR>

    APPEND text-204 TO WA_TEXT. "<BR>

    APPEND text-205 TO WA_TEXT. "<BR>

    APPEND text-206 TO WA_TEXT. "<BR>

    LOOP AT lt_PLANT INTO WA_PLANT.

    lv_alertid = text-223.

    SELECT SINGLE LAND1 INTO lv_country FROM t001w

    WHERE WERKS eq wa_PLANT-WERKS.

    IF SY-SUBRC <> 0.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    SELECT ROLE INTO TABLE lt_Getrole

    FROM ZMMIN_ALERT_ROLE WHERE ALERTID = lv_alertid

    AND country = lv_country

    AND BLOCK EQ space.

    CLEAR : gs_PURREQ-MENGE.

    LOOP at LV_PURREQ into gs_PURREQ WHERE WERKS-WERKS EQ WA_PLANT-WERKS.

    CONCATENATE text-208 text-219 text-222 gs_PURREQ-BANFN text-222 text-220 gs_PURREQ-BANFN text-221 text-209 into TEXT.

    Append TEXT TO WA_TEXT.

    • clear : WA_TEXT.

    CONCATENATE text-210 gs_PURREQ-BNFPO text-209 into TEXT.

    Append TEXT TO WA_TEXT.

    • clear : WA_TEXT.

    iv_PRQTY = gs_PURREQ-MENGE.

    CONCATENATE text-211 iv_PRQTY text-209 into TEXT.

    Append TEXT TO WA_TEXT.

    • clear : WA_TEXT.

    CONCATENATE text-210 gs_PURREQ-MEINS text-209 into TEXT.

    Append TEXT TO WA_TEXT.

    • clear : WA_TEXT.

    CONCATENATE text-210 gs_PURREQ-WERKS text-209 into TEXT.

    Append TEXT TO WA_TEXT.

    • clear : WA_TEXT.

    CONCATENATE text-210 gs_PURREQ-EKGRP text-209 into TEXT.

    Append TEXT TO WA_TEXT.

    • clear : WA_TEXT.

    iv_totalqty = iv_totalqty + gs_PURREQ-MENGE.

    *at LAST.

    • clear : WA_TEXT.

    • CONCATENATE text-207 ' ' into text.

    *endat.

    ENDLOOP.

    CONCATENATE text-208 Text-218 INTO TEXT.

    Append TEXT TO WA_TEXT.

    • clear : WA_TEXT.

    CONCATENATE text-210 '' text-209 INTO TEXT.

    Append TEXT TO WA_TEXT.

    • clear : WA_TEXT.

    iv_totalqtyC = iv_totalqty.

    CONCATENATE text-210 iv_totalqtyC text-209 INTO TEXT.

    Append TEXT TO WA_TEXT.

    APPEND text-203 TO WA_TEXT. "<BR>

    APPEND text-203 TO WA_TEXT. "<BR>

    APPEND text-214 TO WA_TEXT. "</table>

    APPEND text-215 TO WA_TEXT. "</body></html>

    • for mail ************************************

    SORT lt_Getrole BY ROLE.

    LOOP at lt_Getrole INTO ls_Getrole.

    CONCATENATE ls_Getrole-ROLE+0(2) 'D%' WA_PLANT-WERKS INTO lc_pattern.

    *Select Profit Center based derived role

    SELECT agr_name INTO TABLE lt_roles FROM agr_define

    WHERE agr_name LIKE lc_pattern

    AND parent_agr = ls_Getrole-role.

    *Get the User id in this Role

    CALL FUNCTION '/VIRSA/BAPI_AE_USERS_FOR_ROLES'

    TABLES

    ROLE_LIST = lt_roles

    USER_LIST = lt_Getuser.

    if lt_Getuser IS NOT INITIAL.

    LOOP at lt_Getuser INTO ls_Getuser.

    mailrec-receiver = ls_Getuser-USERID.

    mailrec-rec_type = 'B'.

    APPEND mailrec TO LS_Mailrec .

    ENDLOOP.

    CLEAR : lt_Getuser.

    ENDIF.

    ENDLOOP.

    • for mail ************************************

    CONCATENATE text-100 sy-datum INTO textsub SEPARATED BY space .

    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

    EXPORTING

    document_data = Textsub

    DOCUMENT_TYPE = 'HTM'

    PUT_IN_OUTBOX = 'X'

    • COMMIT_WORK = ' '

    • IMPORTING

    • SENT_TO_ALL =

    • NEW_OBJECT_ID =

    tables

    OBJECT_CONTENT = WA_TEXT

    receivers = LS_Mailrec

    EXCEPTIONS

    TOO_MANY_RECEIVERS = 1

    DOCUMENT_NOT_SENT = 2

    DOCUMENT_TYPE_NOT_EXIST = 3

    OPERATION_NO_AUTHORIZATION = 4

    PARAMETER_ERROR = 5

    X_ERROR = 6

    ENQUEUE_ERROR = 7

    OTHERS = 8.

    IF sy-subrc <> 0.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    CLEAR : LS_Mailrec.

    COMMIT WORK.

    ENDLOOP.

    CLEAR : lt_Getuser.

    Endif.

    ENDFORM. " display_data

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 25, 2008 at 08:06 AM

    Hi Muthu,

    Thanks a lot for the code you sent,but this code is sending mail. What I want is that using the FM i sould be able to send the data in FAX.

    Please help me in that..

    Regards,

    Vidya.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 11:55 AM

    Could use the classes.

    Regards,

    Vidya.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.