‎2007 Oct 21 5:31 PM
Hi,
We have a requirement to upload code groups and codes using QS41. We used the LSMW and uploaded the code groups , but when we tried writing a BDC for uploading codes of the codegroup the dialog tree structure that comes in the left hand frame of QS41 did not appear in SHDB recording. Please let me know how this could be captured in the BDC
Also if it is the case that all screen sequences could not be captured in BDC and we need to use BAPI_QPGR_SAVEREPLICA for using codes, please let me know the parameters which are to be used / any sample where this BAPI has been used.
Your help is greatly appreciated. Thanks.
Regards,
Prabaharan.G
‎2007 Oct 21 6:59 PM
Hi
See the sample BDC protgram for CODE ZGROUPS
REPORT zpm_code_group_upload
NO STANDARD PAGE HEADING LINE-SIZE 255.
Standard Include for Selection Screen
INCLUDE bdcrecx1.
Internal Table for Upload Data
DATA: BEGIN OF i_codegroup OCCURS 0,
katalogart(001), " Catalog
codegruppe(008), " Code Group
kurztext(040), " Description
status(001), " Status
END OF i_codegroup.
Parameters
PARAMETERS: p_file LIKE ibipparms-path. " Filename
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start of Selection
START-OF-SELECTION.
Open the BDC Session
PERFORM open_group.
Upload the File into internal Table
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_codegroup
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
sort i_codegroup by katalogart.
Upload the Data from Internal Table
LOOP AT i_codegroup.
Initial Screen
PERFORM bdc_dynpro USING 'SAPLQSBA' '0010'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/EAEND'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RQSBA-CODEGRUPPE'.
PERFORM bdc_field USING 'RQSBA-KATALOGART'
i_codegroup-katalogart.
PERFORM bdc_field USING 'RQSBA-CODEGRUPPE'
i_codegroup-codegruppe.
Second Screen
PERFORM bdc_dynpro USING 'SAPLQSBA' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'V_QPGR_KAT-STATUS(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SAVE'.
PERFORM bdc_field USING 'V_QPGR_KAT-KURZTEXT(01)'
i_codegroup-kurztext.
PERFORM bdc_field USING 'V_QPGR_KAT-STATUS(01)'
'2'. "i_codegroup-status.
Call the Transaction
PERFORM bdc_transaction USING 'QS41'.
ENDLOOP.
Close the BDC Session
PERFORM close_group.
Reward if useful
Anji
‎2007 Oct 22 12:59 AM
Hi,
This code will upload the code groups but the requirement is to upload the codes corresponding to the code groups . Can you please let me know if you have uploaded the codes of the code groups.
Regards,
Prabaharan.G
‎2007 Oct 22 11:51 PM
Hi,
This could be done by recording the transaction QS41,
Select the code group --> click on the menu option ---> table view -
> other view and then -
> select codes from the pop up and this will take to the codes screen.
Regards,
Prabaharan.G
‎2007 Oct 22 11:52 PM