on 07-15-2009 1:06 PM
Hi All,
I have a requirement wherein I need to add supporting documents to a Webdynpro application online. The attachments can be of any type and any number of attachments can be added. If any of you had worked in such a kind of requirement please give some inputs.
Thanks
Subathra
Hi,
i think we can't add an attachment here rathere we can upload the file to to applicarion server
you can do as below
1. create a file upload UIElement.
2.capture the file name in to context element
3.use the following code on your action
DATA: it_bdcdata TYPE TABLE OF bdcdata,
wa_bdcdata TYPE bdcdata,
it_messtab TYPE TABLE OF bdcmsgcoll,
wa_messtab TYPE bdcmsgcoll.
DATA: MSG_TEXT(200) TYPE C.
PERFORM BATCH_INPUT.
CALL TRANSACTION 'CG3Z'
USING IT_BDCDATA
MODE 'A'
UPDATE 'S'
MESSAGES INTO IT_MESSTAB.
LOOP AT IT_MESSTAB INTO WA_MESSTAB.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = WA_MESSTAB-MSGID
LANG = WA_MESSTAB-MSGSPRA
NO = WA_MESSTAB-MSGNR
V1 = WA_MESSTAB-MSGV1
V2 = WA_MESSTAB-MSGV2
V3 = WA_MESSTAB-MSGV3
V4 = WA_MESSTAB-MSGV4
IMPORTING
MSG = MSG_TEXT
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE:/ MSG_TEXT.
ENDLOOP.
*
&----
*& Form BATCH_INPUT
&----
text
----
--> p1 text
<-- p2 text
----
form BATCH_INPUT .
PERFORM bdc_dynpro USING 'SAPLC13Z' '1020'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RCGFILETR-FTFTYPE'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=EIMP'.
PERFORM bdc_field USING 'RCGFILETR-FTFRONT'
*HERE PASS YOU FILE NAME .
PERFORM bdc_field USING 'RCGFILETR-FTAPPL'
HERE PASS THE FILE NAME ON THE APPLICATION SERVER
PERFORM bdc_field USING 'RCGFILETR-FTFTYPE'
'BIN'.
PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=YES'.
perform bdc_dynpro using 'SAPLC13Z' '1020'.
perform bdc_field using 'BDC_OKCODE'
'/EECAN'.
endform. " BATCH_INPUT
&----
*& Form BDC_DYNPRO
&----
text
----
-->P_0112 text
-->P_0113 text
----
form BDC_DYNPRO using program
dynpro.
*Fill internal table with program name and screen number
CLEAR WA_BDCDATA.
WA_BDCDATA-PROGRAM = PROGRAM.
WA_BDCDATA-DYNPRO = DYNPRO.
WA_BDCDATA-DYNBEGIN = 'X'.
APPEND WA_BDCDATA TO IT_BDCDATA.
endform. " BDC_DYNPRO
&----
*& Form BDC_FIELD
&----
text
----
-->P_0117 text
-->P_0118 text
----
form BDC_FIELD using fnam
fval.
CLEAR WA_BDCDATA.
WA_BDCDATA-FNAM = FNAM.
WA_BDCDATA-FVAL = FVAL.
APPEND WA_BDCDATA TO IT_BDCDATA.
endform. " BDC_FIELD
Thanks,
Shaik Shadulla.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can try using Fileupload uielement.
Check stantdard component WDR_TEST_EVENTS ( View - FILEUPLOAD ).
If you could be more clear/ give more details would help us give better solutions
Regards,
Radhika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.